diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-02-26 11:02:17 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-02-26 21:15:41 +0100 |
commit | ea58b039ab455b38aabbd20e8e50ec8965a1d69d (patch) | |
tree | 0010ec68a8da3c8dad5c34c27d42bfc0acd9a5b6 /vcl/win | |
parent | 0a29c928afa74123bca05dc089c751603d368467 (diff) |
loplugin:indentation (clang-cl)
Change-Id: I94689e4eed290b4505d2caba2d9802ef7fb6cffd
Reviewed-on: https://gerrit.libreoffice.org/68378
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/gdi/gdiimpl.cxx | 2 | ||||
-rw-r--r-- | vcl/win/gdi/salgdi2.cxx | 78 | ||||
-rw-r--r-- | vcl/win/gdi/salnativewidgets-luna.cxx | 2 | ||||
-rw-r--r-- | vcl/win/gdi/salvd.cxx | 56 | ||||
-rw-r--r-- | vcl/win/window/salframe.cxx | 102 | ||||
-rw-r--r-- | vcl/win/window/salmenu.cxx | 8 |
6 files changed, 124 insertions, 124 deletions
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 84e82b5abd61..835c84013c59 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -976,7 +976,7 @@ void WinSalGraphicsImpl::ResetClipRegion() mrParent.mhRegion = nullptr; } - SelectClipRgn( mrParent.getHDC(), nullptr ); + SelectClipRgn( mrParent.getHDC(), nullptr ); } static bool containsOnlyHorizontalAndVerticalEdges(const basegfx::B2DPolygon& rCandidate) diff --git a/vcl/win/gdi/salgdi2.cxx b/vcl/win/gdi/salgdi2.cxx index 394ac4acebe8..ceddcb5b2c8a 100644 --- a/vcl/win/gdi/salgdi2.cxx +++ b/vcl/win/gdi/salgdi2.cxx @@ -114,50 +114,50 @@ public: void convertToWinSalBitmap(SalBitmap& rSalBitmap, WinSalBitmap& rWinSalBitmap) { - BitmapPalette aBitmapPalette; - OpenGLSalBitmap* pGLSalBitmap = dynamic_cast<OpenGLSalBitmap*>(&rSalBitmap); - if (pGLSalBitmap != nullptr) - { - aBitmapPalette = pGLSalBitmap->GetBitmapPalette(); - } - - BitmapBuffer* pRead = rSalBitmap.AcquireBuffer(BitmapAccessMode::Read); - - rWinSalBitmap.Create(rSalBitmap.GetSize(), rSalBitmap.GetBitCount(), aBitmapPalette); - BitmapBuffer* pWrite = rWinSalBitmap.AcquireBuffer(BitmapAccessMode::Write); - - sal_uInt8* pSource(pRead->mpBits); - sal_uInt8* pDestination(pWrite->mpBits); - - std::unique_ptr<ColorScanlineConverter> pConverter; - - if (pRead->mnFormat == ScanlineFormat::N24BitTcRgb) - pConverter.reset(new ColorScanlineConverter(ScanlineFormat::N24BitTcRgb, ScanlineFormat::N24BitTcBgr, - 3, pRead->mnScanlineSize)); - else if (pRead->mnFormat == ScanlineFormat::N32BitTcRgba) - pConverter.reset(new ColorScanlineConverter(ScanlineFormat::N32BitTcRgba, ScanlineFormat::N32BitTcBgra, - 4, pRead->mnScanlineSize)); - if (pConverter) + BitmapPalette aBitmapPalette; + OpenGLSalBitmap* pGLSalBitmap = dynamic_cast<OpenGLSalBitmap*>(&rSalBitmap); + if (pGLSalBitmap != nullptr) + { + aBitmapPalette = pGLSalBitmap->GetBitmapPalette(); + } + + BitmapBuffer* pRead = rSalBitmap.AcquireBuffer(BitmapAccessMode::Read); + + rWinSalBitmap.Create(rSalBitmap.GetSize(), rSalBitmap.GetBitCount(), aBitmapPalette); + BitmapBuffer* pWrite = rWinSalBitmap.AcquireBuffer(BitmapAccessMode::Write); + + sal_uInt8* pSource(pRead->mpBits); + sal_uInt8* pDestination(pWrite->mpBits); + + std::unique_ptr<ColorScanlineConverter> pConverter; + + if (pRead->mnFormat == ScanlineFormat::N24BitTcRgb) + pConverter.reset(new ColorScanlineConverter(ScanlineFormat::N24BitTcRgb, ScanlineFormat::N24BitTcBgr, + 3, pRead->mnScanlineSize)); + else if (pRead->mnFormat == ScanlineFormat::N32BitTcRgba) + pConverter.reset(new ColorScanlineConverter(ScanlineFormat::N32BitTcRgba, ScanlineFormat::N32BitTcBgra, + 4, pRead->mnScanlineSize)); + if (pConverter) + { + for (long y = 0; y < pRead->mnHeight; y++) { - for (long y = 0; y < pRead->mnHeight; y++) - { - pConverter->convertScanline(pSource, pDestination); - pSource += pRead->mnScanlineSize; - pDestination += pWrite->mnScanlineSize; - } + pConverter->convertScanline(pSource, pDestination); + pSource += pRead->mnScanlineSize; + pDestination += pWrite->mnScanlineSize; } - else + } + else + { + for (long y = 0; y < pRead->mnHeight; y++) { - for (long y = 0; y < pRead->mnHeight; y++) - { - memcpy(pDestination, pSource, pRead->mnScanlineSize); - pSource += pRead->mnScanlineSize; - pDestination += pWrite->mnScanlineSize; - } + memcpy(pDestination, pSource, pRead->mnScanlineSize); + pSource += pRead->mnScanlineSize; + pDestination += pWrite->mnScanlineSize; } - rWinSalBitmap.ReleaseBuffer(pWrite, BitmapAccessMode::Write); + } + rWinSalBitmap.ReleaseBuffer(pWrite, BitmapAccessMode::Write); - rSalBitmap.ReleaseBuffer(pRead, BitmapAccessMode::Read); + rSalBitmap.ReleaseBuffer(pRead, BitmapAccessMode::Read); } } // end anonymous namespace diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index 9066a21ca884..efa69457c083 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -1425,7 +1425,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, aBoxRect.SetRight( aBoxRect.Left() + aRect.GetWidth() ); rNativeContentRegion = aBoxRect; rNativeBoundingRegion = rNativeContentRegion; - bRet = TRUE; + bRet = TRUE; } } } diff --git a/vcl/win/gdi/salvd.cxx b/vcl/win/gdi/salvd.cxx index 695ee68d56f1..57ad9581b1c4 100644 --- a/vcl/win/gdi/salvd.cxx +++ b/vcl/win/gdi/salvd.cxx @@ -36,38 +36,38 @@ HBITMAP WinSalVirtualDevice::ImplCreateVirDevBitmap(HDC hDC, long nDX, long nDY, { HBITMAP hBitmap; - if ( nBitCount == 1 ) - { - hBitmap = CreateBitmap( static_cast<int>(nDX), static_cast<int>(nDY), 1, 1, nullptr ); - SAL_WARN_IF( !hBitmap, "vcl", "CreateBitmap failed: " << WindowsErrorString( GetLastError() ) ); - ppData = nullptr; - } - else - { - if (nBitCount == 0) - nBitCount = static_cast<WORD>(GetDeviceCaps(hDC, BITSPIXEL)); + if ( nBitCount == 1 ) + { + hBitmap = CreateBitmap( static_cast<int>(nDX), static_cast<int>(nDY), 1, 1, nullptr ); + SAL_WARN_IF( !hBitmap, "vcl", "CreateBitmap failed: " << WindowsErrorString( GetLastError() ) ); + ppData = nullptr; + } + else + { + if (nBitCount == 0) + nBitCount = static_cast<WORD>(GetDeviceCaps(hDC, BITSPIXEL)); // #146839# Don't use CreateCompatibleBitmap() - there seem to // be built-in limits for those HBITMAPs, at least this fails // rather often on large displays/multi-monitor setups. - BITMAPINFO aBitmapInfo; - aBitmapInfo.bmiHeader.biSize = sizeof( BITMAPINFOHEADER ); - aBitmapInfo.bmiHeader.biWidth = nDX; - aBitmapInfo.bmiHeader.biHeight = nDY; - aBitmapInfo.bmiHeader.biPlanes = 1; - aBitmapInfo.bmiHeader.biBitCount = nBitCount; - aBitmapInfo.bmiHeader.biCompression = BI_RGB; - aBitmapInfo.bmiHeader.biSizeImage = 0; - aBitmapInfo.bmiHeader.biXPelsPerMeter = 0; - aBitmapInfo.bmiHeader.biYPelsPerMeter = 0; - aBitmapInfo.bmiHeader.biClrUsed = 0; - aBitmapInfo.bmiHeader.biClrImportant = 0; - - hBitmap = CreateDIBSection( hDC, &aBitmapInfo, - DIB_RGB_COLORS, ppData, nullptr, - 0 ); - SAL_WARN_IF( !hBitmap, "vcl", "CreateDIBSection failed: " << WindowsErrorString( GetLastError() ) ); - } + BITMAPINFO aBitmapInfo; + aBitmapInfo.bmiHeader.biSize = sizeof( BITMAPINFOHEADER ); + aBitmapInfo.bmiHeader.biWidth = nDX; + aBitmapInfo.bmiHeader.biHeight = nDY; + aBitmapInfo.bmiHeader.biPlanes = 1; + aBitmapInfo.bmiHeader.biBitCount = nBitCount; + aBitmapInfo.bmiHeader.biCompression = BI_RGB; + aBitmapInfo.bmiHeader.biSizeImage = 0; + aBitmapInfo.bmiHeader.biXPelsPerMeter = 0; + aBitmapInfo.bmiHeader.biYPelsPerMeter = 0; + aBitmapInfo.bmiHeader.biClrUsed = 0; + aBitmapInfo.bmiHeader.biClrImportant = 0; + + hBitmap = CreateDIBSection( hDC, &aBitmapInfo, + DIB_RGB_COLORS, ppData, nullptr, + 0 ); + SAL_WARN_IF( !hBitmap, "vcl", "CreateDIBSection failed: " << WindowsErrorString( GetLastError() ) ); + } return hBitmap; } diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 6a654e3cc01f..6ecec9c2938f 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -3395,19 +3395,19 @@ static bool ImplHandleKeyMsg( HWND hWnd, UINT nMsg, pFrame->CallCallback( SalEvent::KeyUp, &aKeyEvt ); return nRet; } - // #i11583#, MCD, 2003-01-13, Support for WM_UNICHAR & Keyman 6.0; addition begins + // #i11583#, MCD, 2003-01-13, Support for WM_UNICHAR & Keyman 6.0; addition begins else if( nMsg == WM_UNICHAR ) - { - // If Windows is asking if we accept WM_UNICHAR, return TRUE - if(wParam == UNICODE_NOCHAR) + { + // If Windows is asking if we accept WM_UNICHAR, return TRUE + if(wParam == UNICODE_NOCHAR) { rResult = TRUE; // ssa: this will actually return TRUE to windows return true; // ...but this will only avoid calling the defwindowproc } - SalKeyEvent aKeyEvt; - aKeyEvt.mnCode = nModCode; // Or should it be 0? - as this is always a character returned - aKeyEvt.mnRepeat = 0; + SalKeyEvent aKeyEvt; + aKeyEvt.mnCode = nModCode; // Or should it be 0? - as this is always a character returned + aKeyEvt.mnRepeat = 0; if( wParam >= Uni_SupplementaryPlanesStart ) { @@ -3417,19 +3417,19 @@ static bool ImplHandleKeyMsg( HWND hWnd, UINT nMsg, nLastVKChar = 0; pFrame->CallCallback( SalEvent::KeyInput, &aKeyEvt ); pFrame->CallCallback( SalEvent::KeyUp, &aKeyEvt ); - wParam = static_cast<sal_Unicode>(Uni_UTF32ToSurrogate2( wParam )); - } + wParam = static_cast<sal_Unicode>(Uni_UTF32ToSurrogate2( wParam )); + } - aKeyEvt.mnCharCode = static_cast<sal_Unicode>(wParam); + aKeyEvt.mnCharCode = static_cast<sal_Unicode>(wParam); - nLastChar = 0; - nLastVKChar = 0; - bool nRet = pFrame->CallCallback( SalEvent::KeyInput, &aKeyEvt ); - pFrame->CallCallback( SalEvent::KeyUp, &aKeyEvt ); + nLastChar = 0; + nLastVKChar = 0; + bool nRet = pFrame->CallCallback( SalEvent::KeyInput, &aKeyEvt ); + pFrame->CallCallback( SalEvent::KeyUp, &aKeyEvt ); - return nRet; - } - // MCD, 2003-01-13, Support for WM_UNICHAR & Keyman 6.0; addition ends + return nRet; + } + // MCD, 2003-01-13, Support for WM_UNICHAR & Keyman 6.0; addition ends else { // for shift, control and menu we issue a KeyModChange event @@ -3898,32 +3898,32 @@ static void ImplCallClosePopupsHdl( HWND hWnd ) static void ImplHandleMoveMsg( HWND hWnd ) { WinSalFrame* pFrame = ProcessOrDeferMessage( hWnd, SAL_MSG_POSTMOVE ); - if ( pFrame ) - { - UpdateFrameGeometry( hWnd, pFrame ); + if ( pFrame ) + { + UpdateFrameGeometry( hWnd, pFrame ); - if ( GetWindowStyle( hWnd ) & WS_VISIBLE ) - pFrame->mbDefPos = false; + if ( GetWindowStyle( hWnd ) & WS_VISIBLE ) + pFrame->mbDefPos = false; - // protect against recursion - if ( !pFrame->mbInMoveMsg ) - { - // adjust window again for FullScreenMode - pFrame->mbInMoveMsg = true; - if ( pFrame->mbFullScreen ) - ImplSalFrameFullScreenPos( pFrame ); - pFrame->mbInMoveMsg = false; - } + // protect against recursion + if ( !pFrame->mbInMoveMsg ) + { + // adjust window again for FullScreenMode + pFrame->mbInMoveMsg = true; + if ( pFrame->mbFullScreen ) + ImplSalFrameFullScreenPos( pFrame ); + pFrame->mbInMoveMsg = false; + } - // save state - ImplSaveFrameState( pFrame ); + // save state + ImplSaveFrameState( pFrame ); - // Call Hdl - //#93851 if we call this handler, VCL floating windows are not updated correctly - ImplCallMoveHdl( hWnd ); + // Call Hdl + //#93851 if we call this handler, VCL floating windows are not updated correctly + ImplCallMoveHdl( hWnd ); - ImplSalYieldMutexRelease(); - } + ImplSalYieldMutexRelease(); + } } static void ImplCallSizeHdl( HWND hWnd ) @@ -3931,15 +3931,15 @@ static void ImplCallSizeHdl( HWND hWnd ) // as Windows can send these messages also, we have to use // the Solar semaphore WinSalFrame* pFrame = ProcessOrDeferMessage( hWnd, SAL_MSG_POSTCALLSIZE ); - if ( pFrame ) - { - pFrame->CallCallback( SalEvent::Resize, nullptr ); - // to avoid double Paints by VCL and SAL - if ( IsWindowVisible( hWnd ) && !pFrame->mbInShow ) - UpdateWindow( hWnd ); + if ( pFrame ) + { + pFrame->CallCallback( SalEvent::Resize, nullptr ); + // to avoid double Paints by VCL and SAL + if ( IsWindowVisible( hWnd ) && !pFrame->mbInShow ) + UpdateWindow( hWnd ); - ImplSalYieldMutexRelease(); - } + ImplSalYieldMutexRelease(); + } } static void ImplHandleSizeMsg( HWND hWnd, WPARAM wParam, LPARAM lParam ) @@ -3997,11 +3997,11 @@ static void ImplHandleFocusMsg( HWND hWnd ) static void ImplHandleCloseMsg( HWND hWnd ) { WinSalFrame* pFrame = ProcessOrDeferMessage( hWnd, WM_CLOSE ); - if ( pFrame ) - { - pFrame->CallCallback( SalEvent::Close, nullptr ); - ImplSalYieldMutexRelease(); - } + if ( pFrame ) + { + pFrame->CallCallback( SalEvent::Close, nullptr ); + ImplSalYieldMutexRelease(); + } } static bool ImplHandleShutDownMsg( HWND hWnd ) diff --git a/vcl/win/window/salmenu.cxx b/vcl/win/window/salmenu.cxx index 8caaf1227b9f..9466d0cf8052 100644 --- a/vcl/win/window/salmenu.cxx +++ b/vcl/win/window/salmenu.cxx @@ -154,7 +154,7 @@ void WinSalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) { if( pSalMenuItem ) { - WinSalMenuItem* pWItem = static_cast<WinSalMenuItem*>(pSalMenuItem); + WinSalMenuItem* pWItem = static_cast<WinSalMenuItem*>(pSalMenuItem); if( nPos == MENU_APPEND ) { nPos = ::GetMenuItemCount( mhMenu ); @@ -269,7 +269,7 @@ void WinSalMenu::SetItemImage( unsigned /*nPos*/, SalMenuItem* pSalMenuItem, con { if( pSalMenuItem ) { - WinSalMenuItem* pWItem = static_cast<WinSalMenuItem*>(pSalMenuItem); + WinSalMenuItem* pWItem = static_cast<WinSalMenuItem*>(pSalMenuItem); if( !!rImage ) pWItem->maBitmap = rImage.GetBitmapEx().GetBitmap(); else @@ -281,7 +281,7 @@ void WinSalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const OU { if( pSalMenuItem ) { - WinSalMenuItem* pWItem = static_cast<WinSalMenuItem*>(pSalMenuItem); + WinSalMenuItem* pWItem = static_cast<WinSalMenuItem*>(pSalMenuItem); pWItem->mText = rText; // 'translate' mnemonics pWItem->mText = pWItem->mText.replaceAll( "~", "&" ); @@ -308,7 +308,7 @@ void WinSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const { if( pSalMenuItem ) { - WinSalMenuItem* pWItem = static_cast<WinSalMenuItem*>(pSalMenuItem); + WinSalMenuItem* pWItem = static_cast<WinSalMenuItem*>(pSalMenuItem); pWItem->mAccelText = rKeyName; pWItem->mInfo.fMask = MIIM_TYPE | MIIM_DATA; pWItem->mInfo.fType = MFT_STRING; |