summaryrefslogtreecommitdiffstats
path: root/sax/source/expatwrap
diff options
context:
space:
mode:
Diffstat (limited to 'sax/source/expatwrap')
-rw-r--r--sax/source/expatwrap/sax_expat.cxx32
-rw-r--r--sax/source/expatwrap/saxwriter.cxx31
2 files changed, 33 insertions, 30 deletions
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index 83dff1afe9f5..4f00ad9f378e 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -129,7 +129,11 @@ OUString XmlChar2OUString( const XML_Char *p )
class SaxExpatParser_Impl;
-static Sequence< OUString > SaxExpatParser_getSupportedServiceNames(void)
+OUString SaxExpatParser_getImplementationName() {
+ return OUString("com.sun.star.comp.extensions.xml.sax.ParserExpat");
+}
+
+Sequence< OUString > SaxExpatParser_getSupportedServiceNames(void)
{
Sequence<OUString> seq(1);
seq[0] = OUString("com.sun.star.xml.sax.Parser");
@@ -594,7 +598,7 @@ void SaxExpatParser::setLocale( const Locale & locale ) throw (RuntimeException)
// XServiceInfo
OUString SaxExpatParser::getImplementationName() throw ()
{
- return OUString("com.sun.star.comp.extensions.xml.sax.ParserExpat");
+ return SaxExpatParser_getImplementationName();
}
// XServiceInfo
@@ -1019,27 +1023,25 @@ void SaxExpatParser_Impl::callbackEndCDATA( void *pvThis )
CALL_ELEMENT_HANDLER_AND_CARE_FOR_EXCEPTIONS(pImpl,rExtendedDocumentHandler->endCDATA() );
}
-} // namespace
-
-static Reference< XInterface > SaxExpatParser_CreateInstance(
- SAL_UNUSED_PARAMETER const Reference< XMultiServiceFactory > & )
- throw(Exception)
+Reference< XInterface > SAL_CALL SaxExpatParser_CreateInstance(
+ SAL_UNUSED_PARAMETER const Reference<css::uno::XComponentContext> & )
+ SAL_THROW((css::uno::Exception))
{
SaxExpatParser *p = new SaxExpatParser;
return Reference< XInterface > ( (OWeakObject * ) p );
}
+} // namespace
+
extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL
com_sun_star_comp_extensions_xml_sax_ParserExpat_component_getFactory(
- const char * , void *pServiceManager, void * )
+ const char *, void *, void * )
{
- Reference< XSingleServiceFactory > xFactory;
- Reference< XMultiServiceFactory > xSMgr =
- reinterpret_cast< XMultiServiceFactory * >( pServiceManager );
- xFactory = createSingleFactory( xSMgr,
- "com.sun.star.comp.extensions.xml.sax.ParserExpat",
- SaxExpatParser_CreateInstance,
- SaxExpatParser_getSupportedServiceNames() );
+ Reference<css::lang::XSingleComponentFactory> xFactory(
+ cppu::createSingleComponentFactory(
+ &SaxExpatParser_CreateInstance,
+ SaxExpatParser_getImplementationName(),
+ SaxExpatParser_getSupportedServiceNames()));
xFactory->acquire();
return xFactory.get();
}
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index a6b9a31d0a4e..b17f3787ac10 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -867,7 +867,11 @@ static inline sal_Int32 getFirstLineBreak( const OUString & str ) throw ()
return -1;
}
-static Sequence< OUString > SAXWriter_getSupportedServiceNames(void) throw ()
+OUString SAXWriter_getImplementationName() {
+ return OUString("com.sun.star.extensions.xml.sax.Writer");
+}
+
+Sequence< OUString > SAXWriter_getSupportedServiceNames(void) throw ()
{
Sequence<OUString> seq(1);
seq.getArray()[0] = OUString("com.sun.star.xml.sax.Writer");
@@ -994,7 +998,7 @@ static inline sal_Bool isFirstCharWhitespace( const sal_Unicode *p ) throw()
// XServiceInfo
OUString SAXWriter::getImplementationName() throw()
{
- return OUString("com.sun.star.extensions.xml.sax.Writer");
+ return SAXWriter_getImplementationName();
}
// XServiceInfo
@@ -1372,27 +1376,24 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc
}
}
-} // namespace
-
-static Reference < XInterface > SAXWriter_CreateInstance(
- SAL_UNUSED_PARAMETER const Reference < XMultiServiceFactory > & )
- throw (Exception)
+Reference < XInterface > SAL_CALL SAXWriter_CreateInstance(
+ SAL_UNUSED_PARAMETER const Reference<css::uno::XComponentContext> & )
+ SAL_THROW((css::uno::Exception))
{
SAXWriter *p = new SAXWriter;
return Reference< XInterface > ( (static_cast< OWeakObject * >(p)) );
}
+} // namespace
+
extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL
com_sun_star_extensions_xml_sax_Writer_component_getFactory(
- const char * , void *pServiceManager, void * )
+ const char *, void *, void * )
{
- Reference< XSingleServiceFactory > xFactory;
- Reference< XMultiServiceFactory > xSMgr =
- reinterpret_cast< XMultiServiceFactory * >( pServiceManager );
- xFactory = createSingleFactory( xSMgr,
- "com.sun.star.extensions.xml.sax.Writer",
- SAXWriter_CreateInstance,
- SAXWriter_getSupportedServiceNames() );
+ Reference<css::lang::XSingleComponentFactory > xFactory(
+ cppu::createSingleComponentFactory(
+ &SAXWriter_CreateInstance, SAXWriter_getImplementationName(),
+ SAXWriter_getSupportedServiceNames()));
xFactory->acquire();
return xFactory.get();
}