summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-03-31 17:56:35 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-03-31 17:56:35 +0200
commitabfaae8bf10b3bd18fe2155474cc861e934d7925 (patch)
treed6c314df49401e8f391c09f1b989c6b773ba8c12
parent841dad721392acab01e1b679dee5bb62014c6ed8 (diff)
xmloff: assign the number format supplier at construction
Change-Id: Ieb6af6351312a15bb71bbd8534d021a805b194a7
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx4
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx13
2 files changed, 13 insertions, 4 deletions
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 88420d62cdc0..aaddc433b8a7 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -257,10 +257,6 @@ void lcl_setDataProvider(uno::Reference<chart2::XChartDocument> xChartDoc, OUStr
Reference<lang::XMultiServiceFactory> xFact(xChild->getParent(), uno::UNO_QUERY);
if (xFact.is())
{
- //if the parent has a number formatter we will use the numberformatter of the parent
- Reference<util::XNumberFormatsSupplier> xNumberFormatsSupplier(xFact, uno::UNO_QUERY);
- xDataReceiver->attachNumberFormatsSupplier(xNumberFormatsSupplier);
-
if (!xChartDoc->getDataProvider().is())
{
bool bHasDataPilotSource = !sDataPilotSource.isEmpty();
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index a240a9344989..10d8fc105b39 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -591,6 +591,19 @@ void SAL_CALL SchXMLImport::setTargetDocument(const uno::Reference<lang::XCompon
// prevent rebuild of view during load (necesarry especially if loaded not
// via load api, which is the case for example if binary files are loaded)
xChartDoc->lockControllers();
+
+ uno::Reference<container::XChild> xChild(xChartDoc, uno::UNO_QUERY);
+ uno::Reference<chart2::data::XDataReceiver> xDataReceiver(xChartDoc, uno::UNO_QUERY);
+ if (xChild.is() && xDataReceiver.is())
+ {
+ Reference<lang::XMultiServiceFactory> xFact(xChild->getParent(), uno::UNO_QUERY);
+ if (xFact.is())
+ {
+ //if the parent has a number formatter we will use the numberformatter of the parent
+ Reference<util::XNumberFormatsSupplier> xNumberFormatsSupplier(xFact, uno::UNO_QUERY);
+ xDataReceiver->attachNumberFormatsSupplier(xNumberFormatsSupplier);
+ }
+ }
}
catch (const uno::Exception & rEx)
{