From e899a75fc6dd600ea9992c851a42734b334122b6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 1 Jun 2023 13:41:51 +0200 Subject: 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 --- sax/qa/cppunit/parser.cxx | 1 - sax/source/expatwrap/expwrap.component | 4 ++++ sax/source/fastparser/fastparser.cxx | 14 ++------------ sax/source/fastparser/legacyfastparser.cxx | 13 ++++++------- 4 files changed, 12 insertions(+), 20 deletions(-) (limited to 'sax') diff --git a/sax/qa/cppunit/parser.cxx b/sax/qa/cppunit/parser.cxx index 88e0ebd90cf9..261091fe8769 100644 --- a/sax/qa/cppunit/parser.cxx +++ b/sax/qa/cppunit/parser.cxx @@ -12,7 +12,6 @@ #include #include #include -#include #include #include diff --git a/sax/source/expatwrap/expwrap.component b/sax/source/expatwrap/expwrap.component index dbc9822c566d..1f72eccf3145 100644 --- a/sax/source/expatwrap/expwrap.component +++ b/sax/source/expatwrap/expwrap.component @@ -27,6 +27,10 @@ constructor="com_sun_star_extensions_xml_sax_Writer_get_implementation"> + + + diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index d92d0de0321d..344dda9cd63e 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -28,13 +27,8 @@ #include #include #include -#include #include -#include #include -#include -#include -#include #include #include #include @@ -1490,9 +1484,9 @@ void FastSaxParser::registerNamespace( const OUString& NamespaceURL, sal_Int32 N mpImpl->registerNamespace(NamespaceURL, NamespaceToken); } -OUString FastSaxParser::getNamespaceURL( std::u16string_view aPrefix ) +OUString FastSaxParser::getNamespaceURL( const OUString& rPrefix ) { - return mpImpl->getNamespaceURL(aPrefix); + return mpImpl->getNamespaceURL(rPrefix); } void FastSaxParser::setErrorHandler( const uno::Reference< xml::sax::XErrorHandler >& Handler ) @@ -1681,9 +1675,5 @@ static bool NormalizeOasisURN( OUString& rName ) return true; } -XFastParser::~XFastParser() {} - -XImportFilter2::~XImportFilter2() {} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/fastparser/legacyfastparser.cxx b/sax/source/fastparser/legacyfastparser.cxx index 8dd5e5379aa0..62e7b8a57a88 100644 --- a/sax/source/fastparser/legacyfastparser.cxx +++ b/sax/source/fastparser/legacyfastparser.cxx @@ -19,16 +19,13 @@ #include #include -#include -#include -#include +#include #include #include #include #include #include #include -#include #include #include #include @@ -118,7 +115,7 @@ public: sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; private: - rtl::Reference< sax_fastparser::FastSaxParser > m_xParser; + Reference< XFastParser > m_xParser; Reference< XDocumentHandler > m_xDocumentHandler; Reference< XFastTokenHandler > m_xTokenHandler; @@ -284,7 +281,7 @@ void SAL_CALL CallbackDocumentHandler::characters( const OUString& aChars ) } SaxLegacyFastParser::SaxLegacyFastParser( ) : m_aNamespaceHandler( new NamespaceHandler ), - m_xParser(new sax_fastparser::FastSaxParser) + m_xParser(FastParser::create(::comphelper::getProcessComponentContext() )) { m_xParser->setNamespaceHandler( m_aNamespaceHandler ); } @@ -311,7 +308,9 @@ void SAL_CALL SaxLegacyFastParser::initialize(Sequence< Any > const& rArguments } else { - m_xParser->initialize( rArguments ); + uno::Reference const xInit(m_xParser, + uno::UNO_QUERY_THROW); + xInit->initialize( rArguments ); } } -- cgit