diff --git a/include/oox/core/filterbase.hxx b/include/oox/core/filterbase.hxx index e341de4e0885..22a15a8eb52d 100644 --- a/include/oox/core/filterbase.hxx +++ b/include/oox/core/filterbase.hxx @@ -180,6 +180,9 @@ public: the imported document. */ ModelObjectHelper& getModelObjectHelper() const; + ModelObjectHelper& getModelObjectHelperForModel( + const css::uno::Reference& xFactory) const; + /** Returns a helper for the handling of OLE objects. */ ::oox::ole::OleObjectHelper& getOleObjectHelper() const; 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, 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& xFactory) const +{ + if (!mxImpl->mxModelObjHelpers.count(xFactory)) + mxImpl->mxModelObjHelpers[xFactory] = std::make_shared(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 #include #include +#include #include #include #include @@ -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 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 xFactory(getChartDocument(), uno::UNO_QUERY); + ModelObjectHelper& rHelper = getFilter().getModelObjectHelperForModel(xFactory); + importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper(), + rHelper); } } // import leaderline of data labels