summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2019-01-23 22:13:21 -0900
committerJim Raykowski <raykowj@gmail.com>2019-02-02 05:03:21 +0100
commit6850fcef74f7d3d82dc17143dd1befdf250977d7 (patch)
treefa86429ab7aad3203806b6a6e29d91019def071a /cui
parentcec3fe24dd4569bf04b13e0284823bad129dbb86 (diff)
Fix bitmap not being selected and displayed in bitmap tab page
The background tab page uses SvxBrushItem. Area tab page uses XFillBitmapItem. setSvxBrushItemAsFillAttributesToTargetSet creates empty string for XFillBitmapItem name. Bitmap can be identified by GraphicObject::GetUniqueId. Use this to select bitmap in bitmap tab page bitmap list. Change-Id: Ic739c0b462502a986358bf00acfbac01fafd19f7 Reviewed-on: https://gerrit.libreoffice.org/66838 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'cui')
-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();