summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2021-10-02 15:07:18 +1000
committerTomaž Vajngerl <quikee@gmail.com>2021-10-20 16:04:14 +0200
commita9dfe0187f21dce9d7cee4c4e938d8592073e09c (patch)
tree7bca24491716719114176a13610c920dd3ee2d76 /vcl
parent3667da75208e6ccc6deb927555c861ddb3d34dd5 (diff)
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 <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/outdev/wallpaper.cxx21
1 files changed, 14 insertions, 7 deletions
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: