diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2020-05-04 11:48:51 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-07-15 12:05:51 +0200 |
commit | e6dc487a24a4e65794707276e7ca5f9a2ffba191 (patch) | |
tree | c450af3e61010e219481b33a8a4078e1d5175f35 /oox | |
parent | 9afcab2a2169041f65ae6281aa8992594dda9866 (diff) |
tdf#131175 Import data label solid fill and color.
(cherry picked from commit 603df08a1e0211099ce2cf258cfe64a74ed6ded9)
Conflicts:
oox/source/drawingml/chart/seriesconverter.cxx
Change-Id: I8a3ef6e60d4f2a13310bb9a8fc4eb873df3f9b4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98807
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/chart/seriesconverter.cxx | 23 | ||||
-rw-r--r-- | oox/source/token/properties.txt | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 02479b80ec46..1551e2727591 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/chart2/data/LabeledDataSequence.hpp> #include <com/sun/star/chart2/XFormattedString2.hpp> #include <com/sun/star/chart2/FormattedString.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> #include <osl/diagnose.h> #include <basegfx/numeric/ftools.hxx> #include <drawingml/chart/datasourceconverter.hxx> @@ -40,6 +41,7 @@ #include <drawingml/chart/titleconverter.hxx> #include <drawingml/chart/typegroupconverter.hxx> #include <drawingml/chart/typegroupmodel.hxx> +#include <drawingml/fillproperties.hxx> #include <oox/core/xmlfilterbase.hxx> #include <oox/helper/containerhelper.hxx> #include <oox/helper/attributelist.hxx> @@ -236,6 +238,20 @@ void importBorderProperties( PropertySet& rPropSet, Shape& rShape, const Graphic rPropSet.setProperty(PROP_LabelBorderColor, uno::makeAny(nColor)); } +void importFillProperties( PropertySet& rPropSet, Shape& rShape, const GraphicHelper& rGraphicHelper ) +{ + FillProperties& rFP = rShape.getFillProperties(); + + if (rFP.moFillType.has() && rFP.moFillType.get() == XML_solidFill) + { + rPropSet.setProperty(PROP_LabelFillStyle, drawing::FillStyle_SOLID); + + const Color& aColor = rFP.maFillColor; + ::Color nColor = aColor.getColor(rGraphicHelper); + rPropSet.setProperty(PROP_LabelFillColor, uno::makeAny(nColor)); + } +} + DataPointCustomLabelFieldType lcl_ConvertFieldNameToFieldEnum( const OUString& rField ) { if (rField == "VALUE") @@ -294,8 +310,10 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat } if (mrModel.mxShapeProp) + { importBorderProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); - + importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); + } if( mrModel.mxText && mrModel.mxText->mxTextBody && !mrModel.mxText->mxTextBody->getParagraphs().empty() ) { css::uno::Reference< XComponentContext > xContext = getComponentContext(); @@ -378,8 +396,11 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa lclConvertLabelFormatting( aPropSet, getFormatter(), mrModel, rTypeGroup, true, bMSO2007Doc ); if (mrModel.mxShapeProp) + { // Import baseline border properties for these data labels. importBorderProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); + importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); + } } // data point label settings diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index b4ee4ba0f9c4..3dd942df9903 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -283,6 +283,8 @@ LabelBorderWidth LabelPlacement LabelPosition LabelSeparator +LabelFillStyle +LabelFillColor CustomLabelFields LayoutInfo LeftBorder |