summaryrefslogtreecommitdiff
path: root/chart2/source/view/main
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2022-08-17 23:22:41 +0200
committerTomaž Vajngerl <quikee@gmail.com>2022-08-18 08:48:17 +0200
commite425ee936ee762825a20cd10e6027163eab747a2 (patch)
treea35ed072c1bd6b8f1da19d9eaf47efde98012e40 /chart2/source/view/main
parent3115a9f3a903f14a71003f51dc30eed824ea92fb (diff)
chart2: convert the fill color only when style is "solid"
The CharBackColor should only be set when the fill style has the value "FillStyle_SOLID", otherwise don't set it as we can't handle any other fill style. Change-Id: Icaec8996d47966bb32bd8cf88b8c5aad70ab07a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138462 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2/source/view/main')
-rw-r--r--chart2/source/view/main/DataTableView.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx
index e5f3933aa8cb..5e1a7157cc3e 100644
--- a/chart2/source/view/main/DataTableView.cxx
+++ b/chart2/source/view/main/DataTableView.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/drawing/LineDash.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/util/XBroadcaster.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -143,8 +144,14 @@ void DataTableView::setCellCharAndParagraphProperties(
copyProperty(xPropertySet, xDataTableProperties, "CharWeightComplex");
copyProperty(xPropertySet, xDataTableProperties, "CharWordMode");
- xPropertySet->setPropertyValue("CharBackColor",
- xDataTableProperties->getPropertyValue("FillColor"));
+ drawing::FillStyle eFillStyle = drawing::FillStyle_NONE;
+ xDataTableProperties->getPropertyValue("FillStyle") >>= eFillStyle;
+ if (eFillStyle == drawing::FillStyle_SOLID)
+ {
+ sal_Int32 aColor = 0;
+ if (xDataTableProperties->getPropertyValue("FillColor") >>= aColor)
+ xPropertySet->setPropertyValue("CharBackColor", uno::Any(aColor));
+ }
xPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_CENTER));
}