diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-07-01 09:39:09 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-07-01 10:37:05 +0200 |
commit | e18bc316efbd815b047f4e19ebd033e7a842d10d (patch) | |
tree | fc41c0a84595ea8fe8ee25e161904d168066165c /oox | |
parent | 194c9eecc30837d6d4a6caaba76ef96745f09db0 (diff) |
Related: tdf#131175 OOXML chart: insert hatch definition into the right table
Both the chart and the containing document has one, but the intention is
to insert this into the chart one.
This is needed, but not enough to render the right hatch for data
labels.
Change-Id: I485d84e2ae33728963b648c05e730d418567fc0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97569
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/filterbase.cxx | 10 | ||||
-rw-r--r-- | oox/source/drawingml/chart/seriesconverter.cxx | 11 |
2 files changed, 19 insertions, 2 deletions
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index 2eea42a8decf..cabd522b962d 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -137,6 +137,8 @@ struct FilterBaseImpl GraphicHelperRef mxGraphicHelper; /// Graphic and graphic object handling. ModelObjHelperRef mxModelObjHelper; /// Tables to create new named drawing objects. + std::map<css::uno::Reference<css::lang::XMultiServiceFactory>, ModelObjHelperRef> + mxModelObjHelpers; OleObjHelperRef mxOleObjHelper; /// OLE object handling. VbaProjectRef mxVbaProject; /// VBA project manager. @@ -352,6 +354,14 @@ ModelObjectHelper& FilterBase::getModelObjectHelper() const return *mxImpl->mxModelObjHelper; } +ModelObjectHelper& FilterBase::getModelObjectHelperForModel( + const css::uno::Reference<css::lang::XMultiServiceFactory>& xFactory) const +{ + if (!mxImpl->mxModelObjHelpers.count(xFactory)) + mxImpl->mxModelObjHelpers[xFactory] = std::make_shared<ModelObjectHelper>(xFactory); + return *mxImpl->mxModelObjHelpers[xFactory]; +} + OleObjectHelper& FilterBase::getOleObjectHelper() const { if( !mxImpl->mxOleObjHelper ) diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index f2df3aebe536..4124d83d3d55 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -33,6 +33,7 @@ #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/lang/XMultiServiceFactory.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <osl/diagnose.h> #include <drawingml/chart/datasourceconverter.hxx> @@ -283,7 +284,10 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat if (mrModel.mxShapeProp) { importBorderProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); - importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper(), getFilter().getModelObjectHelper()); + uno::Reference<lang::XMultiServiceFactory> xFactory(getChartDocument(), uno::UNO_QUERY); + ModelObjectHelper& rHelper = getFilter().getModelObjectHelperForModel(xFactory); + importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper(), + rHelper); } if( mrModel.mxText && mrModel.mxText->mxTextBody && !mrModel.mxText->mxTextBody->getParagraphs().empty() ) { @@ -370,7 +374,10 @@ 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(), getFilter().getModelObjectHelper()); + uno::Reference<lang::XMultiServiceFactory> xFactory(getChartDocument(), uno::UNO_QUERY); + ModelObjectHelper& rHelper = getFilter().getModelObjectHelperForModel(xFactory); + importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper(), + rHelper); } } // import leaderline of data labels |