diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2020-05-04 11:48:51 +0300 |
---|---|---|
committer | Gülşah Köse <gulsah.kose@collabora.com> | 2020-05-04 21:04:39 +0200 |
commit | 603df08a1e0211099ce2cf258cfe64a74ed6ded9 (patch) | |
tree | 135c13a729ff18260f7bdb71346d1d5c920f1ab7 /oox | |
parent | e7f3731b8d3e930f85e7df0c0e55bbb1aaea191b (diff) |
tdf#131175 Import data label solid fill and color.
Change-Id: I8a3ef6e60d4f2a13310bb9a8fc4eb873df3f9b4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93407
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@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 b12f4416100b..6591e7277040 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -32,12 +32,14 @@ #include <com/sun/star/chart2/XRegressionCurveContainer.hpp> #include <com/sun/star/chart2/data/XDataSink.hpp> #include <com/sun/star/chart2/data/LabeledDataSequence.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> #include <osl/diagnose.h> #include <drawingml/chart/datasourceconverter.hxx> #include <drawingml/chart/seriesmodel.hxx> #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/token/properties.hxx> @@ -199,6 +201,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") @@ -246,8 +262,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(); @@ -330,8 +348,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()); + } } // import leaderline of data labels if( !mrModel.mbShowLeaderLines ) diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 5c507fab553d..667e479107e5 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -287,6 +287,8 @@ LabelBorderWidth LabelPlacement LabelPosition LabelSeparator +LabelFillStyle +LabelFillColor CustomLabelFields LayoutInfo LeftBorder |