diff options
Diffstat (limited to 'sax/source/fastparser/fastparser.cxx')
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 8d17b650cf0d..04cfbee960a9 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -27,7 +27,6 @@ #include <com/sun/star/xml/sax/XFastContextHandler.hpp> #include <com/sun/star/xml/sax/XFastDocumentHandler.hpp> #include <com/sun/star/xml/sax/XFastTokenHandler.hpp> -#include <cppuhelper/factory.hxx> #include <cppuhelper/supportsservice.hxx> #include <osl/conditn.hxx> #include <osl/diagnose.h> @@ -42,9 +41,14 @@ #include <stack> #include <vector> #include <queue> +#include <cassert> #include <cstring> #include <expat.h> +namespace com { namespace sun { namespace star { namespace uno { + class XComponentContext; +} } } } + using namespace ::std; using namespace ::osl; using namespace ::cppu; @@ -57,17 +61,6 @@ using namespace sax_fastparser; namespace { -OUString FastSaxParser_getImplementationName() { - return OUString("com.sun.star.comp.extensions.xml.sax.FastParser"); -} - -uno::Sequence<OUString> FastSaxParser_getSupportedServiceNames() -{ - Sequence<OUString> seq(1); - seq.getArray()[0] = OUString("com.sun.star.xml.sax.FastParser"); - return seq; -} - struct Event; class FastLocatorImpl; struct NamespaceDefine; @@ -1404,7 +1397,7 @@ void FastSaxParser::setLocale( const lang::Locale& rLocale ) OUString FastSaxParser::getImplementationName() throw (uno::RuntimeException) { - return FastSaxParser_getImplementationName(); + return OUString("com.sun.star.comp.extensions.xml.sax.FastParser"); } sal_Bool FastSaxParser::supportsService( const OUString& ServiceName ) @@ -1416,7 +1409,9 @@ sal_Bool FastSaxParser::supportsService( const OUString& ServiceName ) uno::Sequence<OUString> FastSaxParser::getSupportedServiceNames() throw (uno::RuntimeException) { - return FastSaxParser_getSupportedServiceNames(); + Sequence<OUString> seq(1); + seq[0] = OUString("com.sun.star.xml.sax.FastParser"); + return seq; } bool FastSaxParser::hasNamespaceURL( const OUString& rPrefix ) const @@ -1426,25 +1421,16 @@ bool FastSaxParser::hasNamespaceURL( const OUString& rPrefix ) const } // namespace sax_fastparser -static Reference< XInterface > SAL_CALL FastSaxParser_CreateInstance( - SAL_UNUSED_PARAMETER const Reference<css::uno::XComponentContext> & ) - SAL_THROW((css::uno::Exception)) -{ - FastSaxParser *p = new FastSaxParser; - return Reference< XInterface > ( (OWeakObject * ) p ); -} - -extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL -com_sun_star_comp_extensions_xml_sax_FastParser_component_getFactory( - const char *, void *, void * ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_extensions_xml_sax_FastParser( + SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + uno_Sequence * arguments) { - Reference<css::lang::XSingleComponentFactory> xFactory( - cppu::createSingleComponentFactory( - &FastSaxParser_CreateInstance, - FastSaxParser_getImplementationName(), - FastSaxParser_getSupportedServiceNames())); - xFactory->acquire(); - return xFactory.get(); + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + css::uno::Reference<css::uno::XInterface> x( + static_cast<cppu::OWeakObject *>(new FastSaxParser)); + x->acquire(); + return x.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |