summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/image.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi/image.cxx')
-rw-r--r--vcl/source/gdi/image.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx
index 1384e0b1e14d..4b4b204ce4fe 100644
--- a/vcl/source/gdi/image.cxx
+++ b/vcl/source/gdi/image.cxx
@@ -513,11 +513,10 @@ void ImageList::ReplaceImage( const OUString& rImageName, const Image& rImage )
if( nId )
{
- RemoveImage( nId );
-
- if( !mpImplData )
- ImplInit( 0, rImage.GetSizePixel() );
- mpImplData->AddImage( rImageName, nId, rImage.GetBitmapEx());
+ //Just replace the bitmap rather than doing RemoveImage / AddImage
+ //which breaks index-based iteration.
+ ImageAryData *pImg = mpImplData->maNameHash[ rImageName ];
+ pImg->maBitmapEx = rImage.GetBitmapEx();
}
}