Bug 1401069 - Part 5. Remove two local variables since we do not need them. draft
authorcku <cku@mozilla.com>
Mon, 18 Sep 2017 23:28:08 +0800
changeset 668139 be26488180377be845111cbac6bcd1929cd7e6dc
parent 668138 4b117ec1d90c141749d597f4e9f0e63cfea3f36c
child 668140 5fc419fb381e412f17e1fb5f6aa31db892fd4921
push id80936
push usercku@mozilla.com
push dateThu, 21 Sep 2017 04:54:21 +0000
bugs1401069
milestone57.0a1
Bug 1401069 - Part 5. Remove two local variables since we do not need them. dcWidth and dcHieght are used only once, we do not need to define a local variable for any of them. MozReview-Commit-ID: Fw5rHqtUPQN
widget/windows/PDFViaEMFPrintHelper.cpp
--- a/widget/windows/PDFViaEMFPrintHelper.cpp
+++ b/widget/windows/PDFViaEMFPrintHelper.cpp
@@ -82,19 +82,18 @@ PDFViaEMFPrintHelper::RenderPageToDC(HDC
 
   if (aPageWidth <= 0 || aPageHeight <= 0) {
     return false;
   }
 
   FPDF_PAGE pdfPage = mPDFiumEngine->LoadPage(mPDFDoc, aPageIndex);
   NS_ENSURE_TRUE(pdfPage, false);
 
-  int dcWidth = ::GetDeviceCaps(aDC, HORZRES);
-  int dcHeight = ::GetDeviceCaps(aDC, VERTRES);
-  float scaleFactor = ComputeScaleFactor(dcWidth,dcHeight,
+  float scaleFactor = ComputeScaleFactor(::GetDeviceCaps(aDC, HORZRES),
+                                         ::GetDeviceCaps(aDC, VERTRES),
                                          aPageWidth, aPageHeight);
   int savedState = ::SaveDC(aDC);
   ::SetGraphicsMode(aDC, GM_ADVANCED);
   XFORM xform = { 0 };
   xform.eM11 = xform.eM22 = scaleFactor;
   ::ModifyWorldTransform(aDC, &xform, MWT_LEFTMULTIPLY);
 
   // The caller wanted all drawing to happen within the bounds specified.