summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/inc/cuitabarea.hxx1
-rw-r--r--cui/source/tabpages/tpbitmap.cxx20
2 files changed, 19 insertions, 2 deletions
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index b27573d739aa..40ea7ce95592 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -558,6 +558,7 @@ private:
void ClickBitmapHdl_Impl();
void CalculateBitmapPresetSize();
sal_Int32 SearchBitmapList(const OUString& rBitmapName);
+ sal_Int32 SearchBitmapList(const GraphicObject& rGraphicObject);
public:
SvxBitmapTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 39e6b8a2cfa6..d4871d1dbfe0 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -156,9 +156,9 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& rSet )
sal_Int32 nPos( 0 );
if ( !aItem.isPattern() )
{
- nPos = SearchBitmapList( aItem.GetName() );
+ nPos = SearchBitmapList( aItem.GetGraphicObject() );
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
- nPos = 0;
+ return;
}
else
{
@@ -783,6 +783,22 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void)
}
}
+sal_Int32 SvxBitmapTabPage::SearchBitmapList(const GraphicObject& rGraphicObject)
+{
+ long nCount = m_pBitmapList->Count();
+ sal_Int32 nPos = LISTBOX_ENTRY_NOTFOUND;
+
+ for(long i = 0;i < nCount;i++)
+ {
+ if(rGraphicObject.GetUniqueID() == m_pBitmapList->GetBitmap( i )->GetGraphicObject().GetUniqueID())
+ {
+ nPos = i;
+ break;
+ }
+ }
+ return nPos;
+}
+
sal_Int32 SvxBitmapTabPage::SearchBitmapList(const OUString& rBitmapName)
{
long nCount = m_pBitmapList->Count();