[Libreoffice-commits] core.git: vcl/inc vcl/source

Caolán McNamara caolanm at redhat.com
Tue Apr 23 06:46:02 PDT 2013


 vcl/inc/vcl/image.hxx    |    1 +
 vcl/source/gdi/image.cxx |   15 +++++++++++++++
 2 files changed, 16 insertions(+)

New commits:
commit fe45c9ef10442d0991abd7a45d0e7f2d7c1338e1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 23 14:43:01 2013 +0100

    restore ImageList::AddImage variant
    
    correctly removed in 804e86170ff2570fd3826b4ac26d1c927e751ac3
    but we will need it again soon
    
    Change-Id: I52700cb4da0285bf08db20af2d7c314a37c4fee2

diff --git a/vcl/inc/vcl/image.hxx b/vcl/inc/vcl/image.hxx
index dc027f4..0d28bc0 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 11cb3b6..e508b2c 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" );


More information about the Libreoffice-commits mailing list