diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-03-24 09:28:27 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-03-24 10:43:40 +0100 |
commit | 4365d3c120ec3952e051d31fa94ec25633737fda (patch) | |
tree | ae686041ec7fd472676b3cddafd2db83082cdbef | |
parent | 5b4b6b2aad548cdc27ba2aa7d87ff584ec7e97dd (diff) |
Decrease indentation by returning early.
Change-Id: I9ab5b4dbd28c720c9d7cdd8a1642462643abe94c
-rw-r--r-- | vcl/source/gdi/outdev2.cxx | 12 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 39 |
2 files changed, 24 insertions, 27 deletions
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx index d20cd787fe2b..51ee4834ad57 100644 --- a/vcl/source/gdi/outdev2.cxx +++ b/vcl/source/gdi/outdev2.cxx @@ -377,12 +377,12 @@ void OutputDevice::CopyArea( const Point& rDestPt, void OutputDevice::CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 /*nFlags*/) { - if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) - { - aPosAry.mnDestWidth = aPosAry.mnSrcWidth; - aPosAry.mnDestHeight = aPosAry.mnSrcHeight; - mpGraphics->CopyBits( aPosAry, NULL, this, NULL ); - } + if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0) + return; + + aPosAry.mnDestWidth = aPosAry.mnSrcWidth; + aPosAry.mnDestHeight = aPosAry.mnSrcHeight; + mpGraphics->CopyBits(aPosAry, NULL, this, NULL); } void OutputDevice::ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize, diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 857cd1cf2f6e..1e6a339caf2c 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -422,31 +422,28 @@ bool Window::ImplInitGraphics() const void Window::CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 nFlags ) { + if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0) + return; - const Rectangle aSrcRect ( Point( aPosAry.mnSrcX, aPosAry.mnSrcY ), - Size( aPosAry.mnSrcWidth, aPosAry.mnSrcHeight ) ); - - if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) + if (nFlags & COPYAREA_WINDOWINVALIDATE) { - if ( nFlags & COPYAREA_WINDOWINVALIDATE ) - { - ImplMoveAllInvalidateRegions( aSrcRect, - aPosAry.mnDestX-aPosAry.mnSrcX, - aPosAry.mnDestY-aPosAry.mnSrcY, - false ); + const Rectangle aSrcRect(Point(aPosAry.mnSrcX, aPosAry.mnSrcY), + Size(aPosAry.mnSrcWidth, aPosAry.mnSrcHeight)); - mpGraphics->CopyArea( aPosAry.mnDestX, aPosAry.mnDestY, - aPosAry.mnSrcX, aPosAry.mnSrcY, - aPosAry.mnSrcWidth, aPosAry.mnSrcHeight, - SAL_COPYAREA_WINDOWINVALIDATE, this ); - } - else - { - aPosAry.mnDestWidth = aPosAry.mnSrcWidth; - aPosAry.mnDestHeight = aPosAry.mnSrcHeight; - mpGraphics->CopyBits( aPosAry, NULL, this, NULL ); - } + ImplMoveAllInvalidateRegions(aSrcRect, + aPosAry.mnDestX-aPosAry.mnSrcX, + aPosAry.mnDestY-aPosAry.mnSrcY, + false); + + mpGraphics->CopyArea(aPosAry.mnDestX, aPosAry.mnDestY, + aPosAry.mnSrcX, aPosAry.mnSrcY, + aPosAry.mnSrcWidth, aPosAry.mnSrcHeight, + SAL_COPYAREA_WINDOWINVALIDATE, this); + + return; } + + OutputDevice::CopyAreaFinal(aPosAry, nFlags); } void Window::ImplReleaseGraphics( bool bRelease ) |