diff options
author | Carsten Driesner <cd@openoffice.org> | 2002-09-12 14:42:50 +0000 |
---|---|---|
committer | Carsten Driesner <cd@openoffice.org> | 2002-09-12 14:42:50 +0000 |
commit | dc2711b1fa2dccb41884c9abc15abb8e9e610ffe (patch) | |
tree | cbbeca9ed71f1da51be5409bc0897ae4c9a27b06 /sfx2 | |
parent | 570b8a6496ae51d2ed9eb44e36ae342f447c9dde (diff) |
#97007# Fix problem with black icons and icons with big size >208 pixel
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/toolbox/imgmgr.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sfx2/source/toolbox/imgmgr.cxx b/sfx2/source/toolbox/imgmgr.cxx index dac69c5e2771..c5da9d65a738 100644 --- a/sfx2/source/toolbox/imgmgr.cxx +++ b/sfx2/source/toolbox/imgmgr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: imgmgr.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: cd $ $Date: 2002-08-30 09:16:57 $ + * last change: $Author: cd $ $Date: 2002-09-12 15:42:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1370,15 +1370,14 @@ void SfxImageManager::ReplaceImage( USHORT nId, Bitmap* pBmp ) { // Eine neue Bitmap aufnehmen Size aSize = pBmp->GetSizePixel(); + BOOL bBitmapCreated = FALSE; if ( aSize.Width() > 208 || aSize.Height() > 208 ) { - // Maximale Gr"o\se, die f"ur 16x16 und 26x26-BMP n"otig ist - VirtualDevice aDev; + // Use size that fits both toolbar image size (16x16/26x26) Size aSz( 208, 208 ); - aDev.SetOutputSizePixel( aSz ); - aDev.DrawBitmap( Point(), aSz, *pBmp ); - delete pBmp; - pBmp = new Bitmap( aDev.GetBitmap( Point(), aSz ) ); + pBmp = new Bitmap( *pBmp ); + pBmp->Scale( aSz, BMP_SCALE_INTERPOLATE ); + bBitmapCreated = TRUE; } if ( pUserDefList->GetBitmapPos( nId ) == USHRT_MAX ) @@ -1390,12 +1389,10 @@ void SfxImageManager::ReplaceImage( USHORT nId, Bitmap* pBmp ) Image aImage( *pBmp, aColor ); if ( pBmp->GetSizePixel() != pImageList->GetImageSize() ) { - // Evtl. Imagegr"o\se anpassen - VirtualDevice aDev; + // Scale bitmap to fit current toolbar image size Size aSize = pImageList->GetImageSize(); - aDev.SetOutputSizePixel( aSize ); - aDev.DrawBitmap( Point(), aSize, *pBmp ); - aImage = Image( aDev.GetBitmap(Point(), aSize), aColor ); + pBmp->Scale( aSize, BMP_SCALE_INTERPOLATE ); + aImage = Image( *pBmp, aColor ); } // In die User-Liste aufnehmen @@ -1412,7 +1409,10 @@ void SfxImageManager::ReplaceImage( USHORT nId, Bitmap* pBmp ) if ( SfxMacroConfig::IsMacroSlot(nId) ) SfxMacroConfig::GetOrCreate()->RegisterSlotId( nId ); + bReplaced = TRUE; + if ( bBitmapCreated ) + delete pBmp; // Delete temporary bitmap again! } if ( bReplaced ) |