diff options
author | Dmitriy Shilin <dshil@fastmail.com> | 2019-01-13 05:37:12 -0800 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-01-18 15:36:26 +0100 |
commit | a40f12c3f18e4262336fcd51d26dd099eae1e070 (patch) | |
tree | 56b0c86ae1053ae53b2cb1d43d9e003764ef5380 /vcl/win | |
parent | 2a1ea372daa12c0041d2c080a8fab33a6a87950d (diff) |
tdf#107792 vcl/win: introduce ScopedSelectedHBRUSH
Change-Id: I39792ce8442f9e7776b44a489b3c15b908e2f773
Reviewed-on: https://gerrit.libreoffice.org/66253
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/gdi/gdiimpl.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 3b209075defc..e5013631d9ed 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -778,10 +778,9 @@ void WinSalGraphicsImpl::drawMask(const SalTwoRect& rPosAry, SalTwoRect aPosAry = rPosAry; const HDC hDC = mrParent.getHDC(); - ScopedHBRUSH hMaskBrush(CreateSolidBrush(RGB(nMaskColor.GetRed(), - nMaskColor.GetGreen(), - nMaskColor.GetBlue()))); - HBRUSH hOldBrush = SelectBrush(hDC, hMaskBrush.get()); + ScopedSelectedHBRUSH(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 @@ -794,8 +793,6 @@ void WinSalGraphicsImpl::drawMask(const SalTwoRect& rPosAry, } else ImplDrawBitmap( hDC, aPosAry, rSalBitmap, false, 0x00B8074AUL ); - - SelectBrush(hDC, hOldBrush); } std::shared_ptr<SalBitmap> WinSalGraphicsImpl::getBitmap( long nX, long nY, long nDX, long nDY ) @@ -1574,10 +1571,8 @@ void WinSalGraphicsImpl::DrawPixelImpl( long nX, long nY, COLORREF crColor ) return; } - ScopedHBRUSH hBrush(CreateSolidBrush(crColor)); - HBRUSH hOldBrush = SelectBrush(hDC, hBrush.get()); + ScopedSelectedHBRUSH(hDC, CreateSolidBrush(crColor)); PatBlt(hDC, static_cast<int>(nX), static_cast<int>(nY), int(1), int(1), PATINVERT); - SelectBrush(hDC, hOldBrush); } void WinSalGraphicsImpl::drawPixel( long nX, long nY ) |