diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-04 00:04:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-04 01:41:02 +0200 |
commit | ce47b1a9c68a27fc37594148f6be2661f27120ea (patch) | |
tree | 4c9b5c3da29b76c7c8eb23cdbf85c496b0efd87e /vcl/source/window/window2.cxx | |
parent | 6fc2a300ad8b1c6936b513eff94fd527ea74b469 (diff) |
loplugin:flatten in vcl/window
Change-Id: I94e69e988f038e85b1fb78985211d478bb5ed9b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100033
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window/window2.cxx')
-rw-r--r-- | vcl/source/window/window2.cxx | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 8a6809771c3a..cab79f4fcef3 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -273,39 +273,39 @@ void Window::EndTracking( TrackingEventFlags nFlags ) { ImplSVData* pSVData = ImplGetSVData(); - if ( pSVData->mpWinData->mpTrackWin.get() == this ) + if ( pSVData->mpWinData->mpTrackWin.get() != this ) + return; + + if ( pSVData->mpWinData->mpTrackTimer ) { - if ( pSVData->mpWinData->mpTrackTimer ) - { - delete pSVData->mpWinData->mpTrackTimer; - pSVData->mpWinData->mpTrackTimer = nullptr; - } + delete pSVData->mpWinData->mpTrackTimer; + pSVData->mpWinData->mpTrackTimer = nullptr; + } - pSVData->mpWinData->mpTrackWin = nullptr; - pSVData->mpWinData->mnTrackFlags = StartTrackingFlags::NONE; - ReleaseMouse(); + pSVData->mpWinData->mpTrackWin = nullptr; + pSVData->mpWinData->mnTrackFlags = StartTrackingFlags::NONE; + ReleaseMouse(); - // call EndTracking if required + // call EndTracking if required + { + Point aMousePos( mpWindowImpl->mpFrameData->mnLastMouseX, mpWindowImpl->mpFrameData->mnLastMouseY ); + if( ImplIsAntiparallel() ) { - Point aMousePos( mpWindowImpl->mpFrameData->mnLastMouseX, mpWindowImpl->mpFrameData->mnLastMouseY ); - if( ImplIsAntiparallel() ) - { - // re-mirror frame pos at pChild - const OutputDevice *pOutDev = GetOutDev(); - pOutDev->ReMirror( aMousePos ); - } - - MouseEvent aMEvt( ImplFrameToOutput( aMousePos ), - mpWindowImpl->mpFrameData->mnClickCount, MouseEventModifiers::NONE, - mpWindowImpl->mpFrameData->mnMouseCode, - mpWindowImpl->mpFrameData->mnMouseCode ); - TrackingEvent aTEvt( aMEvt, nFlags | TrackingEventFlags::End ); - // CompatTracking effectively - if (!mpWindowImpl || mpWindowImpl->mbInDispose) - return Window::Tracking( aTEvt ); - else - return Tracking( aTEvt ); + // re-mirror frame pos at pChild + const OutputDevice *pOutDev = GetOutDev(); + pOutDev->ReMirror( aMousePos ); } + + MouseEvent aMEvt( ImplFrameToOutput( aMousePos ), + mpWindowImpl->mpFrameData->mnClickCount, MouseEventModifiers::NONE, + mpWindowImpl->mpFrameData->mnMouseCode, + mpWindowImpl->mpFrameData->mnMouseCode ); + TrackingEvent aTEvt( aMEvt, nFlags | TrackingEventFlags::End ); + // CompatTracking effectively + if (!mpWindowImpl || mpWindowImpl->mbInDispose) + return Window::Tracking( aTEvt ); + else + return Tracking( aTEvt ); } } @@ -576,34 +576,34 @@ long Window::GetDrawPixel( OutputDevice const * pDev, long nPixels ) const static void lcl_HandleScrollHelper( ScrollBar* pScrl, double nN, bool isMultiplyByLineSize ) { - if ( pScrl && nN && pScrl->IsEnabled() && pScrl->IsInputEnabled() && ! pScrl->IsInModalMode() ) - { - long nNewPos = pScrl->GetThumbPos(); - - if ( nN == double(-LONG_MAX) ) - nNewPos += pScrl->GetPageSize(); - else if ( nN == double(LONG_MAX) ) - nNewPos -= pScrl->GetPageSize(); - else - { - // allowing both chunked and continuous scrolling - if(isMultiplyByLineSize){ - nN*=pScrl->GetLineSize(); - } + if ( !(pScrl && nN && pScrl->IsEnabled() && pScrl->IsInputEnabled() && ! pScrl->IsInModalMode()) ) + return; - const double fVal = nNewPos - nN; + long nNewPos = pScrl->GetThumbPos(); - if ( !o3tl::convertsToAtLeast(fVal, LONG_MIN) ) - nNewPos = LONG_MIN; - else if ( !o3tl::convertsToAtMost(fVal, LONG_MAX) ) - nNewPos = LONG_MAX; - else - nNewPos = static_cast<long>(fVal); + if ( nN == double(-LONG_MAX) ) + nNewPos += pScrl->GetPageSize(); + else if ( nN == double(LONG_MAX) ) + nNewPos -= pScrl->GetPageSize(); + else + { + // allowing both chunked and continuous scrolling + if(isMultiplyByLineSize){ + nN*=pScrl->GetLineSize(); } - pScrl->DoScroll( nNewPos ); + const double fVal = nNewPos - nN; + + if ( !o3tl::convertsToAtLeast(fVal, LONG_MIN) ) + nNewPos = LONG_MIN; + else if ( !o3tl::convertsToAtMost(fVal, LONG_MAX) ) + nNewPos = LONG_MAX; + else + nNewPos = static_cast<long>(fVal); } + pScrl->DoScroll( nNewPos ); + } bool Window::HandleScrollCommand( const CommandEvent& rCmd, |