summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-04-23 14:43:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-04-23 14:45:18 +0100
commitfe45c9ef10442d0991abd7a45d0e7f2d7c1338e1 (patch)
tree427a9e5293b8230c30c589dc6346c0937a24fcfb
parentdo not install 64-bit MSVCRT on 32-bit Windows (diff)
downloadcore-fe45c9ef10442d0991abd7a45d0e7f2d7c1338e1.tar.gz
core-fe45c9ef10442d0991abd7a45d0e7f2d7c1338e1.zip
restore ImageList::AddImage variant
correctly removed in 804e86170ff2570fd3826b4ac26d1c927e751ac3 but we will need it again soon Change-Id: I52700cb4da0285bf08db20af2d7c314a37c4fee2
-rw-r--r--vcl/inc/vcl/image.hxx1
-rw-r--r--vcl/source/gdi/image.cxx15
2 files changed, 16 insertions, 0 deletions
diff --git a/vcl/inc/vcl/image.hxx b/vcl/inc/vcl/image.hxx
index dc027f493a7f..0d28bc030abd 100644
--- a/vcl/inc/vcl/image.hxx
+++ b/vcl/inc/vcl/image.hxx
@@ -103,6 +103,7 @@ public:
Size GetImageSize() const;
void AddImage( const OUString& rImageName, const Image& rImage );
+ void AddImage( sal_uInt16 nNewId, const Image& rImage );
void ReplaceImage( const OUString& rImageName, const Image& rImage );
diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx
index 11cb3b6c3268..e508b2c85427 100644
--- a/vcl/source/gdi/image.cxx
+++ b/vcl/source/gdi/image.cxx
@@ -505,6 +505,21 @@ sal_uInt16 ImageList::ImplGetImageId( const OUString& rImageName ) const
return 0;
}
+void ImageList::AddImage( sal_uInt16 nId, const Image& rImage )
+{
+ DBG_CHKTHIS( ImageList, NULL );
+ DBG_CHKOBJ( &rImage, Image, NULL );
+ DBG_ASSERT( nId, "ImageList::AddImage(): ImageId == 0" );
+ DBG_ASSERT( GetImagePos( nId ) == IMAGELIST_IMAGE_NOTFOUND, "ImageList::AddImage() - ImageId already exists" );
+ DBG_ASSERT( rImage.mpImplData, "ImageList::AddImage(): Wrong Size" );
+ DBG_ASSERT( !mpImplData || (rImage.GetSizePixel() == mpImplData->maImageSize), "ImageList::AddImage(): Wrong Size" );
+
+ if( !mpImplData )
+ ImplInit( 0, rImage.GetSizePixel() );
+
+ mpImplData->AddImage( rtl::OUString(), nId, rImage.GetBitmapEx());
+}
+
void ImageList::AddImage( const OUString& rImageName, const Image& rImage )
{
DBG_ASSERT( GetImagePos( rImageName ) == IMAGELIST_IMAGE_NOTFOUND, "ImageList::AddImage() - ImageName already exists" );