summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2016-05-06 02:07:56 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2016-05-06 00:57:50 +0000
commitee5850893e15acda1d7ce7cf17da7c80f2fa810a (patch)
treee7e69eeb8fb0b0c06a3d9889a38b9cd4d95994c0
parenttdf#94221 repair dialog for text along path (diff)
downloadcore-ee5850893e15acda1d7ce7cf17da7c80f2fa810a.tar.gz
core-ee5850893e15acda1d7ce7cf17da7c80f2fa810a.zip
vcl: save one heap alloc
Change-Id: I4557d643debbf47c10e1ccd2141f04680333a11d Reviewed-on: https://gerrit.libreoffice.org/24685 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--vcl/source/gdi/wall.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index 7f81368f67b2..26b3448c50a0 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -202,9 +202,10 @@ Wallpaper::~Wallpaper()
void Wallpaper::ImplSetCachedBitmap( BitmapEx& rBmp ) const
{
- if( mpImplWallpaper->mpCache )
- delete const_cast< ImplWallpaper* >(mpImplWallpaper.get())->mpCache;
- const_cast< ImplWallpaper* >(mpImplWallpaper.get())->mpCache = new BitmapEx( rBmp );
+ if( !mpImplWallpaper->mpCache )
+ const_cast< ImplWallpaper* >(mpImplWallpaper.get())->mpCache = new BitmapEx( rBmp );
+ else
+ *const_cast< ImplWallpaper* >(mpImplWallpaper.get())->mpCache = rBmp;
}
const BitmapEx* Wallpaper::ImplGetCachedBitmap() const