summaryrefslogtreecommitdiff
path: root/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-16 09:14:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-16 14:18:19 +0200
commit90fa4426a1be8874baacd21eff8c7c46f8a4371a (patch)
tree7983ed7df691969462e00c5528b848428373e552 /writerperfect/source/calc/MSWorksCalcImportFilter.cxx
parent2df0e599090bc915362e1efb8eb27a37eccdc1f3 (diff)
writerfilter: use the fastparser API when possible
part of the process of making SvXMLImport fastparser-only Change-Id: I9bb2d337954354be63984892e1fc4a7950ca3628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104411 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerperfect/source/calc/MSWorksCalcImportFilter.cxx')
-rw-r--r--writerperfect/source/calc/MSWorksCalcImportFilter.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index 521b7c0dbf5d..83035d8b9926 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -317,18 +317,23 @@ MSWorksCalcImportFilter::filter(const css::uno::Sequence<css::beans::PropertyVal
}
// An XML import service: what we push sax messages to...
- css::uno::Reference<css::xml::sax::XDocumentHandler> xInternalHandler(
- getXContext()->getServiceManager()->createInstanceWithContext(
- writerperfect::DocumentHandlerFor<OdsGenerator>::name(), getXContext()),
- css::uno::UNO_QUERY_THROW);
+ css::uno::Reference<XInterface> xInternalFilter
+ = getXContext()->getServiceManager()->createInstanceWithContext(
+ writerperfect::DocumentHandlerFor<OdsGenerator>::name(), getXContext());
+ assert(xInternalFilter);
+ css::uno::Reference<css::xml::sax::XFastDocumentHandler> xInternalHandler(xInternalFilter,
+ css::uno::UNO_QUERY);
+ assert(xInternalHandler);
// The XImporter sets up an empty target document for XDocumentHandler to write to...
css::uno::Reference<css::document::XImporter> xImporter(xInternalHandler, css::uno::UNO_QUERY);
+ assert(xImporter);
xImporter->setTargetDocument(getTargetDocument());
// OO Graphics Handler: abstract class to handle document SAX messages, concrete implementation here
// writes to in-memory target doc
- writerperfect::DocumentHandler aHandler(xInternalHandler);
+ writerperfect::DocumentHandler aHandler(
+ new SvXMLLegacyToFastDocHandler(dynamic_cast<SvXMLImport*>(xInternalHandler.get())));
writerperfect::WPXSvInputStream input(xInputStream);
OdsGenerator exporter;