diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-08-17 23:22:41 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-08-25 13:09:43 +0200 |
commit | 666d45bf909c0f021f490c8edec7a74280e5be77 (patch) | |
tree | 5a536f5aee71ee456d00b220c23b40f53c9e9077 /chart2 | |
parent | e79e0195b824e05052bbdf27b42b110d01644529 (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>
(cherry picked from commit e425ee936ee762825a20cd10e6027163eab747a2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138794
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/main/DataTableView.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index ab4c224ddf18..080b04cf919f 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::makeAny(style::ParagraphAdjust_CENTER)); } |