Kaydet (Commit) 6c3ceaf3 authored tarafından Jim Raykowski's avatar Jim Raykowski Kaydeden (comit) Katarina Behrens

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: 's avatarJim Raykowski <raykowj@gmail.com>
(cherry picked from commit 6850fcef)
Reviewed-on: https://gerrit.libreoffice.org/71855Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 1c4b5390
......@@ -564,6 +564,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);
......
......@@ -157,9 +157,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
{
......@@ -784,6 +784,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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment