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

Stephan Bergmann sbergman at redhat.com
Mon Jul 17 15:28:32 UTC 2017


 vcl/source/window/window.cxx |    2 +-
 vcl/win/app/salinst.cxx      |    2 +-
 vcl/win/gdi/salbmp.cxx       |    8 ++++++--
 vcl/win/gdi/salprn.cxx       |    2 +-
 vcl/win/window/salframe.cxx  |    6 +++---
 5 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit d4bda10ceef4502ce4717368c6a39ecd709cff7f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jul 17 17:27:02 2017 +0200

    loplugin:unnecessaryparen: vcl (clang-cl)
    
    Change-Id: I3d31a5b56007451a9982602b488ae6ac1baf1f50

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 6e35ebac9815..9f31fc185e29 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3580,7 +3580,7 @@ Reference< css::rendering::XCanvas > Window::ImplGetCanvas( bool bSpriteCanvas )
         // surfaces spanning multiple displays). Note: canvas
         // (without sprite) stays the same)
         const sal_uInt32 nDisplay = static_cast< WinSalFrame* >( mpWindowImpl->mpFrame )->mnDisplay;
-        if( (nDisplay >= Application::GetScreenCount()) )
+        if( nDisplay >= Application::GetScreenCount() )
         {
             xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
                                  bSpriteCanvas ?
diff --git a/vcl/win/gdi/salbmp.cxx b/vcl/win/gdi/salbmp.cxx
index 98b59e771c74..e8f1a1fa99fb 100644
--- a/vcl/win/gdi/salbmp.cxx
+++ b/vcl/win/gdi/salbmp.cxx
@@ -42,6 +42,10 @@
 #include <gdiplus.h>
 #include "postwin.h"
 
+#if defined _MSC_VER
+#undef min
+#undef max
+#endif
 
 inline void ImplSetPixel4( sal_uInt8* pScanline, long nX, const BYTE cIndex )
 {
@@ -762,7 +766,7 @@ HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBits, const
     if( nColors )
     {
         // copy the palette entries if any
-        const sal_uInt16 nMinCount = (std::min)( nColors, rPal.GetEntryCount() );
+        const sal_uInt16 nMinCount = std::min( nColors, rPal.GetEntryCount() );
         if( nMinCount )
             memcpy( pBI->bmiColors, rPal.ImplGetColorBuffer(), nMinCount * sizeof(RGBQUAD) );
     }
@@ -944,7 +948,7 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode
                 PBITMAPINFO     pBI = static_cast<PBITMAPINFO>(GlobalLock( mhDIB ));
                 const sal_uInt16    nCount = pBuffer->maPalette.GetEntryCount();
                 const sal_uInt16    nDIBColorCount = ImplGetDIBColorCount( mhDIB );
-                memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), (std::min)( nDIBColorCount, nCount ) * sizeof( RGBQUAD ) );
+                memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), std::min( nDIBColorCount, nCount ) * sizeof( RGBQUAD ) );
                 GlobalUnlock( mhDIB );
             }
 
diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx
index 11731ddd657d..44cc665c94b4 100644
--- a/vcl/win/gdi/salprn.cxx
+++ b/vcl/win/gdi/salprn.cxx
@@ -685,7 +685,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
     if( nFlags & JobSetFlags::DUPLEXMODE )
     {
         DuplexMode eDuplex = DuplexMode::Unknown;
-        if( (pDevModeW->dmFields & DM_DUPLEX) )
+        if( pDevModeW->dmFields & DM_DUPLEX )
         {
             if( pDevModeW->dmDuplex == DMDUP_SIMPLEX )
                 eDuplex = DuplexMode::Off;
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index b31249db81d2..3c370f50e6b5 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -5817,17 +5817,17 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
             }
             break;
         case WM_IME_REQUEST:
-            if ( (sal_uIntPtr)( wParam ) == IMR_RECONVERTSTRING )
+            if ( (sal_uIntPtr)wParam == IMR_RECONVERTSTRING )
             {
                 nRet = ImplHandleIMEReconvertString( hWnd, lParam );
                 rDef = FALSE;
             }
-            else if( (sal_uIntPtr)( wParam ) == IMR_CONFIRMRECONVERTSTRING )
+            else if( (sal_uIntPtr)wParam == IMR_CONFIRMRECONVERTSTRING )
             {
                 nRet = ImplHandleIMEConfirmReconvertString( hWnd, lParam );
                 rDef = FALSE;
             }
-            else if ( (sal_uIntPtr)( wParam ) == IMR_QUERYCHARPOSITION )
+            else if ( (sal_uIntPtr)wParam == IMR_QUERYCHARPOSITION )
             {
                 if ( ImplSalYieldMutexTryToAcquire() )
                 {
commit 7243c13bdd4cbc528673b658faea6772077fa1f6
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jul 17 17:26:08 2017 +0200

    loplugin:implicitboolconversion: vcl (clang-cl)
    
    Change-Id: I81ae357574e5020a5e2dfb7162d451b985c18766

diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 3b29cf820b01..d6a970e7eca8 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -210,7 +210,7 @@ void ImplSalYieldMutexAcquireWithWait( sal_uLong nCount )
                 osl::Condition::Result res = rCondition.wait();
                 assert(osl::Condition::Result::result_ok == res);
             }
-            while ( 1 );
+            while ( true );
             --nCount;
         }
     }


More information about the Libreoffice-commits mailing list