[Libreoffice-commits] core.git: vcl/win

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Feb 1 08:14:55 UTC 2019


 vcl/win/gdi/gdiimpl.cxx               |    8 ++++----
 vcl/win/gdi/salnativewidgets-luna.cxx |    4 ++--
 vcl/win/gdi/winlayout.cxx             |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 77c9bcb1af09d20a813cc3a16c50a57ab09eb0b5
Author:     Dmitriy Shilin <dshil at fastmail.com>
AuthorDate: Wed Jan 30 21:40:28 2019 -0800
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Feb 1 09:14:30 2019 +0100

    tdf#122820 vcl/win: do not use un-named C++ objects
    
    Change-Id: Ifbaf53ff002f8f61f9f49ab9bb14e7598e006402
    Reviewed-on: https://gerrit.libreoffice.org/67187
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index 432d5add15a5..f4af3a06fecb 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -766,9 +766,9 @@ void WinSalGraphicsImpl::drawMask(const SalTwoRect& rPosAry,
     SalTwoRect  aPosAry = rPosAry;
     const HDC hDC = mrParent.getHDC();
 
-    ScopedSelectedHBRUSH(hDC, CreateSolidBrush(RGB(nMaskColor.GetRed(),
-                                                   nMaskColor.GetGreen(),
-                                                   nMaskColor.GetBlue())));
+    ScopedSelectedHBRUSH hBrush(hDC, CreateSolidBrush(RGB(nMaskColor.GetRed(),
+                                                          nMaskColor.GetGreen(),
+                                                          nMaskColor.GetBlue())));
 
     // WIN/WNT seems to have a minor problem mapping the correct color of the
     // mask to the palette if we draw the DIB directly ==> draw DDB
@@ -1563,7 +1563,7 @@ void WinSalGraphicsImpl::DrawPixelImpl( long nX, long nY, COLORREF crColor )
         return;
     }
 
-    ScopedSelectedHBRUSH(hDC, CreateSolidBrush(crColor));
+    ScopedSelectedHBRUSH hBrush(hDC, CreateSolidBrush(crColor));
     PatBlt(hDC, static_cast<int>(nX), static_cast<int>(nY), int(1), int(1), PATINVERT);
 }
 
diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx
index 7f5a33737d15..9066a21ca884 100644
--- a/vcl/win/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/gdi/salnativewidgets-luna.cxx
@@ -459,7 +459,7 @@ static void impl_drawAeroToolbar( HDC hDC, RECT rc, bool bHorizontal )
         GdiGradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
 
         // and a darker horizontal line under that
-        ScopedSelectedHPEN(hDC, CreatePen(PS_SOLID, 1, RGB( 0xb0, 0xb0, 0xb0)));
+        ScopedSelectedHPEN hPen(hDC, CreatePen(PS_SOLID, 1, RGB( 0xb0, 0xb0, 0xb0)));
 
         MoveToEx( hDC, rc.left, gradient_bottom, nullptr );
         LineTo( hDC, rc.right, gradient_bottom );
@@ -480,7 +480,7 @@ static void impl_drawAeroToolbar( HDC hDC, RECT rc, bool bHorizontal )
             to_x = rc.right;
             from_y = to_y = rc.top;
 
-            ScopedSelectedHPEN(hDC, CreatePen(PS_SOLID, 1, RGB( 0xb0, 0xb0, 0xb0)));
+            ScopedSelectedHPEN hPen(hDC, CreatePen(PS_SOLID, 1, RGB( 0xb0, 0xb0, 0xb0)));
 
             MoveToEx( hDC, from_x, from_y, nullptr );
             LineTo( hDC, to_x, to_y );
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 24dbcb1b9815..9b63fc583516 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -368,7 +368,7 @@ hb_font_t* WinFontInstance::ImplInitHbFont()
         {
             // Get the font metrics.
             HDC hDC = m_pGraphics->getHDC();
-            ScopedSelectedHFONT(hDC, CreateFontIndirectW(&aLogFont));
+            ScopedSelectedHFONT hFont(hDC, CreateFontIndirectW(&aLogFont));
             GetTextMetricsW(hDC, &aFontMetric);
         }
 


More information about the Libreoffice-commits mailing list