summaryrefslogtreecommitdiff
path: root/chart2/source/model
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-03-29 20:04:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-03-30 09:39:22 +0200
commit78f7bd90b96ac168fdacd1e0cb0693ab3861872a (patch)
tree00a73a7bf995478e449f714b2d8bdee44df09d40 /chart2/source/model
parent70f3a94949cce612be9eff14fca94976acfc61a4 (diff)
Resolves: tdf#117162 ImportDocumentHandler expects data provider to exist
already in its ctor which changed since... commit 9009663deb8f0862f419fd99bf0b761c7f923eff Date: Sun Feb 26 22:48:06 2017 +0100 tdf#83257 [API-CHANGE] Pivot chart implementation which defers it, take a probably safely backportable approach here to fix it. Change-Id: I1863791af7ae737f337993833a9cf1429a3a8028 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132286 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2/source/model')
-rw-r--r--chart2/source/model/filter/XMLFilter.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx
index 0f061c66121b..145d4e4a900b 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
@@ -49,6 +50,7 @@
#include <com/sun/star/document/GraphicStorageHandler.hpp>
#include <tools/diagnose_ex.h>
#include <sal/log.hxx>
+#include <xmloff/SchXMLImportHelper.hxx>
using namespace ::com::sun::star;
@@ -448,6 +450,14 @@ ErrCode XMLFilter::impl_ImportStream(
{
try
{
+ // tdf#117162 reportbuilder expects setDataProvider to be called before ctor
+ if (m_sDocumentHandler == "com.sun.star.comp.report.ImportDocumentHandler")
+ {
+ css::uno::Reference<css::chart2::XChartDocument> xChart(m_xTargetDoc, uno::UNO_QUERY);
+ if (xChart)
+ setDataProvider(xChart, OUString());
+ }
+
uno::Sequence< uno::Any > aArgs{
uno::Any(beans::NamedValue("DocumentHandler", uno::Any(xFilter))),
uno::Any(beans::NamedValue("Model", uno::Any(m_xTargetDoc)))