[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 5 19:55:49 UTC 2020


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

New commits:
commit 2eb685b59b63e83d6130fdd2a97ce9bbb8b26823
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: Mon Oct 5 21:55:11 2020 +0200

    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>

diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 6040e32b7bfa..f634cd194aa9 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -339,6 +339,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