Bug 1401069 - Part 4. Change argument type from 'const RECT *' to reference type in WindowsEMF::Playback.
MozReview-Commit-ID: 4StsIm9sqeC
--- a/widget/windows/PDFViaEMFPrintHelper.cpp
+++ b/widget/windows/PDFViaEMFPrintHelper.cpp
@@ -137,17 +137,17 @@ PDFViaEMFPrintHelper::DrawPage(HDC aPrin
WindowsEMF emf;
bool result = emf.InitForDrawing();
NS_ENSURE_TRUE(result, false);
result = RenderPageToDC(emf.GetDC(), aPageIndex, aPageWidth, aPageHeight);
NS_ENSURE_TRUE(result, false);
RECT printRect = {0, 0, aPageWidth, aPageHeight};
- result = emf.Playback(aPrinterDC, &printRect);
+ result = emf.Playback(aPrinterDC, printRect);
return result;
}
bool
PDFViaEMFPrintHelper::DrawPageToFile(const wchar_t* aFilePath,
unsigned int aPageIndex,
int aPageWidth, int aPageHeight)
{
--- a/widget/windows/WindowsEMF.cpp
+++ b/widget/windows/WindowsEMF.cpp
@@ -61,24 +61,23 @@ WindowsEMF::ReleaseEMFHandle()
void
WindowsEMF::ReleaseAllResource()
{
FinishDocument();
ReleaseEMFHandle();
}
bool
-WindowsEMF::Playback(HDC aDeviceContext, const RECT* aRect)
+WindowsEMF::Playback(HDC aDeviceContext, const RECT& aRect)
{
- MOZ_ASSERT(aRect);
if (!FinishDocument()) {
return false;
}
- return ::PlayEnhMetaFile(aDeviceContext, mEmf, aRect) != 0;
+ return ::PlayEnhMetaFile(aDeviceContext, mEmf, &aRect) != 0;
}
bool
WindowsEMF::SaveToFile()
{
if (!FinishDocument()) {
return false;
}
--- a/widget/windows/WindowsEMF.h
+++ b/widget/windows/WindowsEMF.h
@@ -56,17 +56,17 @@ public:
"InitForDrawing/ InitFromFileContents and before"
"Playback/ SaveToFile");
return mDC;
}
/**
* Play the EMF's drawing commands onto the given DC.
*/
- bool Playback(HDC aDeviceContext, const RECT* aRect);
+ bool Playback(HDC aDeviceContext, const RECT& aRect);
/**
* Called to generate the EMF file once a consumer has finished drawing to
* the HDC returned by GetDC(), if initializes the object with the path of a
* file.
*/
bool SaveToFile();