[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - cui/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Mon May 6 20:09:09 UTC 2019


 cui/source/inc/cuitabarea.hxx    |    1 +
 cui/source/tabpages/tpbitmap.cxx |   20 ++++++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

New commits:
commit 6c3ceaf3e4d59c658d0f9e4e1b22204be25f74e2
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Wed Jan 23 22:13:21 2019 -0900
Commit:     Katarina Behrens <Katarina.Behrens at cib.de>
CommitDate: Mon May 6 22:08:25 2019 +0200

    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 at gmail.com>
    (cherry picked from commit 6850fcef74f7d3d82dc17143dd1befdf250977d7)
    Reviewed-on: https://gerrit.libreoffice.org/71855
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index f98a6acc9c6f..8faa44e825f2 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -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);
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index f73301e373a2..78f795ee0cf8 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -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();


More information about the Libreoffice-commits mailing list