From cc1dccb273d63e4df9972f8ca040ecf6715ab4f0 Mon Sep 17 00:00:00 2001 From: cku Date: Mon, 18 Sep 2017 23:19:31 +0800 Subject: [PATCH] Bug 1401069 - Part 3. Declare WindowsEMF::GetDC as const member function. r=fatseng MozReview-Commit-ID: BX7ahnIok2T --HG-- extra : rebase_source : f245814808a1714895dc7e83e38f357fbe29a168 --- widget/windows/WindowsEMF.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/widget/windows/WindowsEMF.h b/widget/windows/WindowsEMF.h index 6f8c077f7520..2bb75f0828fb 100644 --- a/widget/windows/WindowsEMF.h +++ b/widget/windows/WindowsEMF.h @@ -50,7 +50,13 @@ public: * 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.