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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 10 13:37:16 UTC 2020


 sc/source/ui/drawfunc/drawsh2.cxx |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

New commits:
commit f8f21b0465d087beb3f4f900401797608a073f7c
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Sep 29 13:40:41 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Nov 10 14:36:38 2020 +0100

    Set correct gradient color for chart background in sidebar
    
    Change-Id: I98dc177494fddc4a975479e99aba7b6318051b1a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103618
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104202
    Tested-by: Jenkins

diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index cec35f05effa..916e756bc613 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -34,6 +34,7 @@
 #include <svx/sidebar/SelectionChangeHandler.hxx>
 #include <svx/sidebar/SelectionAnalyzer.hxx>
 #include <svx/sidebar/ContextChangeEventMultiplexer.hxx>
+#include <svx/unomid.hxx>
 
 #include <drawsh.hxx>
 #include <drawview.hxx>
@@ -343,6 +344,35 @@ static void setupFillColorForChart(SfxViewShell* pShell, SfxItemSet& rSet)
                                     pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
                                             (".uno:FillColor=" + std::to_string(nFillColor)).c_str());
                             }
+
+                            if (comphelper::LibreOfficeKit::isActive() && xInfo->hasPropertyByName("FillGradientName"))
+                            {
+                                OUString aGradientName;
+                                xPropSet->getPropertyValue("FillGradientName") >>= aGradientName;
+
+                                ::css::uno::Reference< ::css::frame::XController > xChartController = xChart->getCurrentController();
+                                if( xChartController.is() )
+                                {
+                                    css::uno::Reference<css::lang::XMultiServiceFactory> xFact(xChartController->getModel(), css::uno::UNO_QUERY);
+
+                                    if (xFact.is())
+                                    {
+                                        css::uno::Reference<css::container::XNameAccess> xNameAccess(
+                                            xFact->createInstance("com.sun.star.drawing.GradientTable"), css::uno::UNO_QUERY);
+
+                                        if (xNameAccess.is() && xNameAccess->hasByName(aGradientName))
+                                        {
+                                            css::uno::Any aAny = xNameAccess->getByName(aGradientName);
+
+                                            XFillGradientItem aItem;
+                                            aItem.SetName(aGradientName);
+                                            aItem.PutValue(aAny, MID_FILLGRADIENT);
+
+                                            rSet.Put(aItem);
+                                        }
+                                    }
+                                }
+                            }
                         }
                     }
                 }


More information about the Libreoffice-commits mailing list