diff options
Diffstat (limited to 'oox/source/drawingml/chart/seriesconverter.cxx')
-rw-r--r-- | oox/source/drawingml/chart/seriesconverter.cxx | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index c55c3891a975..f2df3aebe536 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/chart2/RelativePosition.hpp> #include <com/sun/star/chart/ErrorBarStyle.hpp> #include <com/sun/star/chart2/DataPointLabel.hpp> +#include <com/sun/star/drawing/Hatch.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/chart2/XDataPointCustomLabelField.hpp> #include <com/sun/star/chart2/DataPointCustomLabelField.hpp> @@ -42,6 +43,7 @@ #include <drawingml/fillproperties.hxx> #include <oox/core/xmlfilterbase.hxx> #include <oox/helper/containerhelper.hxx> +#include <oox/helper/modelobjecthelper.hxx> #include <oox/token/properties.hxx> #include <oox/token/tokens.hxx> #include <drawingml/lineproperties.hxx> @@ -49,6 +51,7 @@ #include <drawingml/textrun.hxx> #include <drawingml/textfield.hxx> #include <drawingml/textbody.hxx> +#include <drawingml/hatchmap.hxx> namespace oox::drawingml::chart { @@ -201,7 +204,7 @@ void importBorderProperties( PropertySet& rPropSet, Shape& rShape, const Graphic rPropSet.setProperty(PROP_LabelBorderColor, uno::makeAny(nColor)); } -void importFillProperties( PropertySet& rPropSet, Shape& rShape, const GraphicHelper& rGraphicHelper ) +void importFillProperties( PropertySet& rPropSet, Shape& rShape, const GraphicHelper& rGraphicHelper, ModelObjectHelper& rModelObjHelper ) { FillProperties& rFP = rShape.getFillProperties(); @@ -213,6 +216,22 @@ void importFillProperties( PropertySet& rPropSet, Shape& rShape, const GraphicHe ::Color nColor = aColor.getColor(rGraphicHelper); rPropSet.setProperty(PROP_LabelFillColor, uno::makeAny(nColor)); } + else if(rFP.moFillType.has() && rFP.moFillType.get() == XML_pattFill) + { + rPropSet.setProperty(PROP_LabelFillStyle, drawing::FillStyle_HATCH); + rPropSet.setProperty(PROP_LabelFillBackground, true); + + Color aHatchColor( rFP.maPatternProps.maPattFgColor ); + drawing::Hatch aHatch = createHatch(rFP.maPatternProps.moPattPreset.get(), aHatchColor.getColor(rGraphicHelper, 0)); + + OUString sHatchName = rModelObjHelper.insertFillHatch(aHatch); + rPropSet.setProperty(PROP_LabelFillHatchName, sHatchName); + + const Color& aColor = rFP.maPatternProps.maPattBgColor; + ::Color nColor = aColor.getColor(rGraphicHelper); + rPropSet.setProperty(PROP_LabelFillColor, uno::makeAny(nColor)); + } + } DataPointCustomLabelFieldType lcl_ConvertFieldNameToFieldEnum( const OUString& rField ) @@ -264,7 +283,7 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat if (mrModel.mxShapeProp) { importBorderProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); - importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); + importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper(), getFilter().getModelObjectHelper()); } if( mrModel.mxText && mrModel.mxText->mxTextBody && !mrModel.mxText->mxTextBody->getParagraphs().empty() ) { @@ -351,7 +370,7 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa { // Import baseline border properties for these data labels. importBorderProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); - importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); + importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper(), getFilter().getModelObjectHelper()); } } // import leaderline of data labels |