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
This commit is contained in:
Miklos Vajna 2020-07-01 09:39:09 +02:00
parent 194c9eecc3
commit e18bc316ef
3 changed files with 22 additions and 2 deletions

View file

@ -180,6 +180,9 @@ public:
the imported document. */
ModelObjectHelper& getModelObjectHelper() const;
ModelObjectHelper& getModelObjectHelperForModel(
const css::uno::Reference<css::lang::XMultiServiceFactory>& xFactory) const;
/** Returns a helper for the handling of OLE objects. */
::oox::ole::OleObjectHelper& getOleObjectHelper() const;

View file

@ -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 )

View file

@ -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