[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - include/oox oox/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 22 10:14:43 UTC 2020


 include/oox/core/filterbase.hxx                |    3 +++
 oox/source/core/filterbase.cxx                 |   10 ++++++++++
 oox/source/drawingml/chart/seriesconverter.cxx |   11 +++++++++--
 3 files changed, 22 insertions(+), 2 deletions(-)

New commits:
commit 9f1d98a6a8a0e61ee4e021ac35d588e4bb025407
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Jul 1 09:39:09 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Jul 22 12:14:05 2020 +0200

    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.
    
    (cherry picked from commit e18bc316efbd815b047f4e19ebd033e7a842d10d)
    
    Change-Id: I485d84e2ae33728963b648c05e730d418567fc0e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99025
    Tested-by: Jenkins
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

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<css::lang::XMultiServiceFactory>& 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<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


More information about the Libreoffice-commits mailing list