summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-09-29 13:40:41 +0200
committerAndras Timar <andras.timar@collabora.com>2020-11-10 14:36:38 +0100
commitf8f21b0465d087beb3f4f900401797608a073f7c (patch)
treeea4d3a2e5ea4fafe5575dfa9ff0d7cc6e142c6a4
parenttdf#133630 Check object type when updating side panel data (diff)
downloadcore-f8f21b0465d087beb3f4f900401797608a073f7c.tar.gz
core-f8f21b0465d087beb3f4f900401797608a073f7c.zip
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@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104202 Tested-by: Jenkins
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx30
1 files changed, 30 insertions, 0 deletions
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);
+ }
+ }
+ }
+ }
}
}
}