Bug 1401069 - Part 3. Declare WindowsEMF::GetDC as const member function.
MozReview-Commit-ID: BX7ahnIok2T
--- a/widget/windows/WindowsEMF.h
+++ b/widget/windows/WindowsEMF.h
@@ -45,17 +45,23 @@ public:
/**
* If this object was initiaziled using InitForDrawing() then this function
* returns an HDC that can be drawn to generate the EMF output. Otherwise it
* returns null. After finishing with the HDC, consumers could call Playback()
* to draw EMF onto the given DC or call SaveToFile() to finish writing the
* EMF file.
*/
- HDC GetDC() { return mDC; }
+ HDC GetDC() const
+ {
+ MOZ_ASSERT(mDC, "GetDC can be used only after "
+ "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);
/**
* Called to generate the EMF file once a consumer has finished drawing to