diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:10:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:10:40 +0100 |
commit | 55f07d4daa76503530d96b9c20b53c59bcd5bcf9 (patch) | |
tree | 7ad8a720341e38258dab12597d25616c3bff8807 /vcl/source/window/syswin.cxx | |
parent | e235da515af0e2a5d5a0cf80773943b65fdb8f7b (diff) |
More loplugin:cstylecast: vcl
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files
Change-Id: I363c01a1ae9e863fca4fb4589829492d7280d711
Diffstat (limited to 'vcl/source/window/syswin.cxx')
-rw-r--r-- | vcl/source/window/syswin.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 28a9924b0203..351a90c8cc2b 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -707,15 +707,15 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) if( std::abs(g.nX-aState.mnX) < 2 && std::abs(g.nY-aState.mnY) < 5 ) { long displacement = g.nTopDecoration ? g.nTopDecoration : 20; - if( (unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.Right() || - (unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.Bottom() ) + if( static_cast<unsigned long>(aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > static_cast<unsigned long>(aDesktop.Right()) || + static_cast<unsigned long>(aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > static_cast<unsigned long>(aDesktop.Bottom()) ) { // displacing would leave screen aState.mnX = g.nLeftDecoration ? g.nLeftDecoration : 10; // should result in (0,0) aState.mnY = displacement; if( bWrapped || - (unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.Right() || - (unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.Bottom() ) + static_cast<unsigned long>(aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > static_cast<unsigned long>(aDesktop.Right()) || + static_cast<unsigned long>(aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > static_cast<unsigned long>(aDesktop.Bottom()) ) break; // further displacement not possible -> break // avoid endless testing bWrapped = true; @@ -775,11 +775,11 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) const SalFrameGeometry& rGeom = pWindow->mpWindowImpl->mpFrame->GetGeometry(); if( nX < 0 ) nX = 0; - if( nX + nWidth > (long) rGeom.nWidth ) + if( nX + nWidth > static_cast<long>(rGeom.nWidth) ) nX = rGeom.nWidth - nWidth; if( nY < 0 ) nY = 0; - if( nY + nHeight > (long) rGeom.nHeight ) + if( nY + nHeight > static_cast<long>(rGeom.nHeight) ) nY = rGeom.nHeight - nHeight; setPosSizePixel( nX, nY, nWidth, nHeight, nPosSize ); maOrgSize = Size( nWidth, nHeight ); |