vcl/source/outdev/wallpaper.cxx |   21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

New commits:
commit a9dfe0187f21dce9d7cee4c4e938d8592073e09c
Author:     Chris Sherlock <chris.sherloc...@gmail.com>
AuthorDate: Sat Oct 2 15:07:18 2021 +1000
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Wed Oct 20 16:04:14 2021 +0200

    vcl: move variable declarations closer to first use in DrawBitmapWallpaper()
    
    Change-Id: I9ad0711480e9626298e643609eaeb2c9da377405
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122978
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx
index a260af4d9596..2cd655c0e80a 100644
--- a/vcl/source/outdev/wallpaper.cxx
+++ b/vcl/source/outdev/wallpaper.cxx
@@ -131,17 +131,12 @@ void OutputDevice::DrawBitmapWallpaper( tools::Long nX, 
tools::Long nY,
 {
     assert(!is_double_buffered_window());
 
-    BitmapEx aBmpEx;
     const BitmapEx* pCached = rWallpaper.ImplGetCachedBitmap();
-    Point aPos;
-    Size aSize;
+
     GDIMetaFile* pOldMetaFile = mpMetaFile;
-    const WallpaperStyle eStyle = rWallpaper.GetStyle();
     const bool bOldMap = mbMap;
-    bool bDrawn = false;
-    bool bDrawGradientBackground = false;
-    bool bDrawColorBackground = false;
 
+    BitmapEx aBmpEx;
     if( pCached )
         aBmpEx = *pCached;
     else
@@ -151,6 +146,11 @@ void OutputDevice::DrawBitmapWallpaper( tools::Long nX, 
tools::Long nY,
     const tools::Long nBmpHeight = aBmpEx.GetSizePixel().Height();
     const bool bTransparent = aBmpEx.IsAlpha();
 
+    const WallpaperStyle eStyle = rWallpaper.GetStyle();
+
+    bool bDrawGradientBackground = false;
+    bool bDrawColorBackground = false;
+
     // draw background
     if( bTransparent )
     {
@@ -180,13 +180,18 @@ void OutputDevice::DrawBitmapWallpaper( tools::Long nX, 
tools::Long nY,
 
     // background of bitmap?
     if( bDrawGradientBackground )
+    {
         DrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
+    }
     else if( bDrawColorBackground && bTransparent )
     {
         DrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
         bDrawColorBackground = false;
     }
 
+    Point aPos;
+    Size aSize;
+
     // calc pos and size
     if( rWallpaper.IsRect() )
     {
@@ -205,6 +210,8 @@ void OutputDevice::DrawBitmapWallpaper( tools::Long nX, 
tools::Long nY,
     Push( vcl::PushFlags::CLIPREGION );
     IntersectClipRegion( tools::Rectangle( Point( nX, nY ), Size( nWidth, 
nHeight ) ) );
 
+    bool bDrawn = false;
+
     switch( eStyle )
     {
     case WallpaperStyle::Scale:

Reply via email to