summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-16 09:16:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-16 12:27:31 +0200
commite1a47ddab37e70c400de254251be38e844117cc1 (patch)
treee1655e9b28e876e64059ba8e8280fbf3beefaddf /chart2
parentc7ada1cc8a294f0d2da32ffc02d0941b1b1afd29 (diff)
chart2: use the fastparser API when possible
part of the process of making SvXMLImport fastparser-only Change-Id: I9fd7dbcc8b5c345f7e86bc06b1b898b7d39f36da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/model/filter/XMLFilter.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx
index 3980e96003e2..76f88027a0e2 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -440,11 +440,11 @@ ErrCode XMLFilter::impl_ImportStream(
aFilterCompArgs[ nArgs++ ] <<= xImportInfo;
// the underlying SvXMLImport implements XFastParser, XImporter, XFastDocumentHandler
- Reference< xml::sax::XDocumentHandler > xDocHandler(
- xFactory->createInstanceWithArgumentsAndContext( rServiceName, aFilterCompArgs, m_xContext ),
- uno::UNO_QUERY_THROW );
-
- Reference< document::XImporter > xImporter( xDocHandler, uno::UNO_QUERY_THROW );
+ Reference< XInterface > xFilter =
+ xFactory->createInstanceWithArgumentsAndContext( rServiceName, aFilterCompArgs, m_xContext );
+ assert(xFilter);
+ Reference< document::XImporter > xImporter( xFilter, uno::UNO_QUERY );
+ assert(xImporter);
xImporter->setTargetDocument( Reference< lang::XComponent >( m_xTargetDoc, uno::UNO_SET_THROW ));
if ( !m_sDocumentHandler.isEmpty() )
@@ -454,30 +454,30 @@ ErrCode XMLFilter::impl_ImportStream(
uno::Sequence< uno::Any > aArgs(2);
beans::NamedValue aValue;
aValue.Name = "DocumentHandler";
- aValue.Value <<= xDocHandler;
+ aValue.Value <<= xFilter;
aArgs[0] <<= aValue;
aValue.Name = "Model";
aValue.Value <<= m_xTargetDoc;
aArgs[1] <<= aValue;
- xDocHandler.set(xFactory->createInstanceWithArgumentsAndContext(m_sDocumentHandler,aArgs,m_xContext), uno::UNO_QUERY_THROW );
+ xFilter = xFactory->createInstanceWithArgumentsAndContext(m_sDocumentHandler,aArgs,m_xContext);
}
catch (const uno::Exception&)
{
- TOOLS_WARN_EXCEPTION("chart2", "");
+ TOOLS_WARN_EXCEPTION("chart2", "failed to instantiate " << m_sDocumentHandler);
}
}
xml::sax::InputSource aParserInput;
aParserInput.aInputStream.set(xInputStream, uno::UNO_QUERY_THROW);
// the underlying SvXMLImport implements XFastParser, XImporter, XFastDocumentHandler
- Reference< xml::sax::XFastParser > xFastParser(xDocHandler, uno::UNO_QUERY);
+ Reference< xml::sax::XFastParser > xFastParser(xFilter, uno::UNO_QUERY);
if (xFastParser.is())
xFastParser->parseStream(aParserInput);
else
{
Reference<xml::sax::XParser> xParser = xml::sax::Parser::create(m_xContext);
- xParser->setDocumentHandler( xDocHandler );
+ xParser->setDocumentHandler( uno::Reference<xml::sax::XDocumentHandler>(xFilter, uno::UNO_QUERY_THROW) );
xParser->parseStream(aParserInput);
}
}