summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-06-01 13:41:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-06-01 15:07:18 +0200
commite899a75fc6dd600ea9992c851a42734b334122b6 (patch)
tree1a54173803fc304f8af8802654ec147c6e6ad38d /sax
parent020d72fb85dac7a52eacb29731b8f2d536a2892d (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 'sax')
-rw-r--r--sax/qa/cppunit/parser.cxx1
-rw-r--r--sax/source/expatwrap/expwrap.component4
-rw-r--r--sax/source/fastparser/fastparser.cxx14
-rw-r--r--sax/source/fastparser/legacyfastparser.cxx13
4 files changed, 12 insertions, 20 deletions
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 <com/sun/star/io/Pipe.hpp>
#include <com/sun/star/xml/sax/FastToken.hpp>
#include <com/sun/star/xml/sax/SAXParseException.hpp>
-#include <com/sun/star/xml/sax/InputSource.hpp>
#include <sax/fastparser.hxx>
#include <sax/fastattribs.hxx>
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">
<service name="com.sun.star.xml.sax.Writer"/>
</implementation>
+ <implementation name="com.sun.star.comp.extensions.xml.sax.FastParser"
+ constructor="com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation">
+ <service name="com.sun.star.xml.sax.FastParser"/>
+ </implementation>
<implementation name="com.sun.star.comp.extensions.xml.sax.LegacyFastParser"
constructor="com_sun_star_comp_extensions_xml_sax_LegacyFastParser_get_implementation">
<service name="com.sun.star.xml.sax.LegacyFastParser"/>
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 <sax/fastparser.hxx>
#include <sax/fastattribs.hxx>
-#include <sax/ximportfilter2.hxx>
#include <utility>
#include <xml2utf.hxx>
@@ -28,13 +27,8 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/xml/sax/FastToken.hpp>
-#include <com/sun/star/xml/sax/InputSource.hpp>
#include <com/sun/star/xml/sax/SAXParseException.hpp>
-#include <com/sun/star/xml/sax/XErrorHandler.hpp>
#include <com/sun/star/xml/sax/XFastContextHandler.hpp>
-#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
-#include <com/sun/star/xml/sax/XFastNamespaceHandler.hpp>
-#include <com/sun/star/xml/sax/XLocator.hpp>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -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 <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
-#include <com/sun/star/xml/sax/XFastNamespaceHandler.hpp>
-#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
-#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
+#include <com/sun/star/xml/sax/FastParser.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/beans/Pair.hpp>
#include <comphelper/attributelist.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/processfactory.hxx>
#include <rtl/ref.hxx>
-#include <sax/fastparser.hxx>
#include <memory>
#include <utility>
#include <vector>
@@ -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<lang::XInitialization> const xInit(m_xParser,
+ uno::UNO_QUERY_THROW);
+ xInit->initialize( rArguments );
}
}