[Libreoffice-commits] core.git: chart2/source svx/source

Katarina Behrens Katarina.Behrens at cib.de
Mon May 14 11:25:17 UTC 2018


 chart2/source/controller/sidebar/ChartAreaPanel.cxx |   31 +++++++++++++++++---
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx   |    2 -
 2 files changed, 28 insertions(+), 5 deletions(-)

New commits:
commit d6d5c1c855a0ce57ab96747b950241065f849b83
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Tue May 8 18:57:38 2018 +0200

    tdf#113688: Pattern fill can be set from sidebar now
    
    Change-Id: I877dd2610aadd1b0118cdb6928a8473af1dc4c73
    Reviewed-on: https://gerrit.libreoffice.org/54020
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
index 907840adcae2..725bb30a22f6 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
@@ -15,8 +15,10 @@
 
 #include <chartview/DrawModelWrapper.hxx>
 
+#include <editeng/memberids.h>
 #include <svx/xfltrit.hxx>
 #include <svx/xflftrit.hxx>
+#include <svx/xbtmpit.hxx>
 #include <svx/unomid.hxx>
 #include <vcl/svapp.hxx>
 
@@ -181,11 +183,27 @@ GraphicObject getXBitmapFromName(const css::uno::Reference<css::frame::XModel>&
     try
     {
         ViewElementListProvider aProvider = getViewElementListProvider(xModel);
-        XBitmapListRef aRef = aProvider.GetBitmapList();
-        size_t n = aRef->Count();
+        XBitmapListRef aBmpRef = aProvider.GetBitmapList();
+        XPatternListRef aPatRef = aProvider.GetPatternList();
+
+        size_t n = aBmpRef->Count();
         for (size_t i = 0; i < n; ++i)
         {
-            const XBitmapEntry* pBitmap = aRef->GetBitmap(i);
+            const XBitmapEntry* pBitmap = aBmpRef->GetBitmap(i);
+            if (!pBitmap)
+                continue;
+
+            if (pBitmap->GetName().equalsIgnoreAsciiCase(rName))
+            {
+                return GraphicObject(pBitmap->GetGraphicObject());
+            }
+        }
+
+        // perhaps it's a pattern
+        size_t m = aPatRef->Count();
+        for (size_t i = 0; i < m; ++i)
+        {
+            const XBitmapEntry* pBitmap = aPatRef->GetBitmap(i);
             if (!pBitmap)
                 continue;
 
@@ -376,7 +394,12 @@ void ChartAreaPanel::setFillStyleAndBitmap(const XFillStyleItem* pStyleItem,
 
     if (pStyleItem)
         xPropSet->setPropertyValue("FillStyle", css::uno::Any(pStyleItem->GetValue()));
-    xPropSet->setPropertyValue("FillBitmapName", css::uno::Any(rBitmapItem.GetValue()));
+
+    css::uno::Any aBitmap;
+    rBitmapItem.QueryValue(aBitmap, MID_BITMAP);
+    OUString aPreferredName = rBitmapItem.GetName();
+    aBitmap <<= PropertyHelper::addBitmapUniqueNameToTable(aBitmap, css::uno::Reference<css::lang::XMultiServiceFactory>(mxModel, css::uno::UNO_QUERY_THROW), aPreferredName);
+    xPropSet->setPropertyValue("FillBitmapName", aBitmap);
 }
 
 void ChartAreaPanel::updateData()
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 3ea94f58daae..1fe3b594ffcf 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -418,7 +418,7 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox&, void)
                         {
                             const XBitmapEntry* pXPatternEntry = pXPatternList->GetBitmap(mnLastPosPattern);
                             aBitmap = pXPatternEntry->GetGraphicObject();
-                            aName = mpLbFillAttr->GetSelectedEntry();
+                            aName = pXPatternEntry->GetName();
                             mpLbFillAttr->SelectEntryPos(mnLastPosPattern);
                         }
                     }


More information about the Libreoffice-commits mailing list