[Libreoffice-commits] core.git: cui/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Feb 2 04:03:47 UTC 2019


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

New commits:
commit 6850fcef74f7d3d82dc17143dd1befdf250977d7
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Wed Jan 23 22:13:21 2019 -0900
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Sat Feb 2 05:03:21 2019 +0100

    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>

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();


More information about the Libreoffice-commits mailing list