diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-06-01 13:41:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-06-01 15:07:18 +0200 |
commit | e899a75fc6dd600ea9992c851a42734b334122b6 (patch) | |
tree | 1a54173803fc304f8af8802654ec147c6e6ad38d /starmath/source/mathml | |
parent | 020d72fb85dac7a52eacb29731b8f2d536a2892d (diff) |
Revert "Convert XFastParser into a normal C++ interface"
This reverts commit 5e68d6cfade45f40b1ad46025a81afe4cb8dd337.
Reason for revert: Seems like outside users have been using this API
Change-Id: I8814cf1eb4f000eeb4cbbb5db9c282d001465993
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152441
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath/source/mathml')
-rw-r--r-- | starmath/source/mathml/import.cxx | 15 | ||||
-rw-r--r-- | starmath/source/mathml/mathmlimport.cxx | 14 |
2 files changed, 14 insertions, 15 deletions
diff --git a/starmath/source/mathml/import.cxx b/starmath/source/mathml/import.cxx index f653705b1391..8a0463283286 100644 --- a/starmath/source/mathml/import.cxx +++ b/starmath/source/mathml/import.cxx @@ -17,6 +17,7 @@ #include <com/sun/star/packages/WrongPasswordException.hpp> #include <com/sun/star/packages/zip/ZipIOException.hpp> #include <com/sun/star/task/XStatusIndicator.hpp> +#include <com/sun/star/xml/sax/FastParser.hpp> #include <com/sun/star/xml/sax/InputSource.hpp> #include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/xml/sax/SAXParseException.hpp> @@ -28,8 +29,6 @@ #include <comphelper/propertysetinfo.hxx> #include <comphelper/servicehelper.hxx> #include <rtl/character.hxx> -#include <sax/xfastparser.hxx> -#include <sax/fastparser.hxx> #include <sfx2/docfile.hxx> #include <sfx2/frame.hxx> #include <sfx2/sfxsids.hrc> @@ -394,17 +393,17 @@ ErrCode SmMLImportWrapper::ReadThroughComponentIS( // Finally, parser the stream try { - XFastParser* pFastParser = dynamic_cast<XFastParser*>(xFilter.get()); + Reference<css::xml::sax::XFastParser> xFastParser(xFilter, UNO_QUERY); Reference<css::xml::sax::XFastDocumentHandler> xFastDocHandler(xFilter, UNO_QUERY); - if (pFastParser) + if (xFastParser) { - pFastParser->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntities); - pFastParser->parseStream(aParserInput); + xFastParser->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntities); + xFastParser->parseStream(aParserInput); } else if (xFastDocHandler) { - rtl::Reference<sax_fastparser::FastSaxParser> xParser - = new sax_fastparser::FastSaxParser; + Reference<css::xml::sax::XFastParser> xParser + = css::xml::sax::FastParser::create(rxContext); xParser->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntities); xParser->setFastDocumentHandler(xFastDocHandler); xParser->parseStream(aParserInput); diff --git a/starmath/source/mathml/mathmlimport.cxx b/starmath/source/mathml/mathmlimport.cxx index 4fcd1e4dc76c..a33a4015846f 100644 --- a/starmath/source/mathml/mathmlimport.cxx +++ b/starmath/source/mathml/mathmlimport.cxx @@ -22,6 +22,7 @@ into one string, xml parser hands them to us line by line rather than all in one go*/ #include <com/sun/star/xml/sax/InputSource.hpp> +#include <com/sun/star/xml/sax/FastParser.hpp> #include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/xml/sax/SAXParseException.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> @@ -39,7 +40,6 @@ one go*/ #include <comphelper/propertysetinfo.hxx> #include <rtl/character.hxx> #include <sal/log.hxx> -#include <sax/fastparser.hxx> #include <sfx2/frame.hxx> #include <sfx2/docfile.hxx> #include <sfx2/sfxsids.hrc> @@ -266,18 +266,18 @@ ErrCode SmXMLImportWrapper::ReadThroughComponent(const Reference<io::XInputStrea // finally, parser the stream try { - XFastParser* pFastParser = dynamic_cast<XFastParser*>(xFilter.get()); + Reference<css::xml::sax::XFastParser> xFastParser(xFilter, UNO_QUERY); Reference<css::xml::sax::XFastDocumentHandler> xFastDocHandler(xFilter, UNO_QUERY); - if (pFastParser) + if (xFastParser) { if (bUseHTMLMLEntities) - pFastParser->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntities); - pFastParser->parseStream(aParserInput); + xFastParser->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntities); + xFastParser->parseStream(aParserInput); } else if (xFastDocHandler) { - rtl::Reference<sax_fastparser::FastSaxParser> xParser - = new sax_fastparser::FastSaxParser; + Reference<css::xml::sax::XFastParser> xParser + = css::xml::sax::FastParser::create(rxContext); if (bUseHTMLMLEntities) xParser->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntities); xParser->setFastDocumentHandler(xFastDocHandler); |