diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-04-19 20:54:13 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-04-19 20:57:05 +0200 |
commit | 8e16c9fa498e61b00724cb44cb4470627014fc27 (patch) | |
tree | 073a04dd49c0217deb93ab2f03193a2a65c18e81 /writerperfect | |
parent | c85ed498bd32733cc9e4574635abbdba40f2aa7c (diff) |
Cleaned up wpftdraw_component_getFactory
...which required switching service implementations from XMultiServiceManager-
based to XComponentContext-based (using comphelper::ComponentContext convenience
helper for the occasional service instantiation via the XComponentContext).
Diffstat (limited to 'writerperfect')
-rw-r--r-- | writerperfect/Library_wpftdraw.mk | 1 | ||||
-rw-r--r-- | writerperfect/source/draw/CDRImportFilter.cxx | 9 | ||||
-rw-r--r-- | writerperfect/source/draw/CDRImportFilter.hxx | 9 | ||||
-rw-r--r-- | writerperfect/source/draw/CMXImportFilter.cxx | 9 | ||||
-rw-r--r-- | writerperfect/source/draw/CMXImportFilter.hxx | 9 | ||||
-rw-r--r-- | writerperfect/source/draw/VisioImportFilter.cxx | 9 | ||||
-rw-r--r-- | writerperfect/source/draw/VisioImportFilter.hxx | 9 | ||||
-rw-r--r-- | writerperfect/source/draw/WPGImportFilter.cxx | 9 | ||||
-rw-r--r-- | writerperfect/source/draw/WPGImportFilter.hxx | 9 | ||||
-rw-r--r-- | writerperfect/source/draw/wpftdraw_genericfilter.cxx | 97 |
10 files changed, 63 insertions, 107 deletions
diff --git a/writerperfect/Library_wpftdraw.mk b/writerperfect/Library_wpftdraw.mk index e4c3b51de2db..15c1492e7b69 100644 --- a/writerperfect/Library_wpftdraw.mk +++ b/writerperfect/Library_wpftdraw.mk @@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_api,wpftdraw,\ )) $(eval $(call gb_Library_use_libraries,wpftdraw,\ + comphelper \ cppu \ cppuhelper \ sal \ diff --git a/writerperfect/source/draw/CDRImportFilter.cxx b/writerperfect/source/draw/CDRImportFilter.cxx index 2476a5567476..7a2538bb73eb 100644 --- a/writerperfect/source/draw/CDRImportFilter.cxx +++ b/writerperfect/source/draw/CDRImportFilter.cxx @@ -33,7 +33,6 @@ #include <osl/diagnose.h> #include <rtl/tencinfo.h> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> @@ -42,6 +41,7 @@ #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/uno/Reference.h> +#include <comphelper/componentcontext.hxx> #include <xmloff/attrlist.hxx> #include <libcdr/libcdr.h> @@ -67,7 +67,6 @@ using com::sun::star::uno::UNO_QUERY; using com::sun::star::uno::XInterface; using com::sun::star::uno::Exception; using com::sun::star::uno::RuntimeException; -using com::sun::star::lang::XMultiServiceFactory; using com::sun::star::beans::PropertyValue; using com::sun::star::document::XFilter; using com::sun::star::document::XExtendedFilterDetection; @@ -107,7 +106,7 @@ throw (RuntimeException) // An XML import service: what we push sax messages to.. OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.XMLOasisImporter" ) ); - Reference < XDocumentHandler > xInternalHandler( mxMSF->createInstance( sXMLImportService ), UNO_QUERY ); + Reference < XDocumentHandler > xInternalHandler( comphelper::ComponentContext( mxContext ).createComponent( sXMLImportService ), UNO_QUERY ); // The XImporter sets up an empty target document for XDocumentHandler to write to.. Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY); @@ -238,13 +237,13 @@ throw (RuntimeException) #undef SERVICE_NAME2 #undef SERVICE_NAME1 -Reference< XInterface > SAL_CALL CDRImportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) +Reference< XInterface > SAL_CALL CDRImportFilter_createInstance( const Reference< XComponentContext > & rContext) throw( Exception ) { #ifdef DEBUG std::cerr << "CDRImportFilter_createInstance" << std::endl; #endif - return (cppu::OWeakObject *) new CDRImportFilter( rSMgr ); + return (cppu::OWeakObject *) new CDRImportFilter( rContext ); } // XServiceInfo diff --git a/writerperfect/source/draw/CDRImportFilter.hxx b/writerperfect/source/draw/CDRImportFilter.hxx index 56f124ea8ebe..9dbb945192ff 100644 --- a/writerperfect/source/draw/CDRImportFilter.hxx +++ b/writerperfect/source/draw/CDRImportFilter.hxx @@ -35,6 +35,7 @@ #include <com/sun/star/document/XExtendedFilterDetection.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <cppuhelper/implbase5.hxx> @@ -54,14 +55,14 @@ class CDRImportFilter : public cppu::WeakImplHelper5 { protected: // oo.org declares - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc; ::rtl::OUString msFilterName; ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler; public: - CDRImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF) - : mxMSF( rxMSF ) {} + CDRImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext) + : mxContext( rxContext ) {} virtual ~CDRImportFilter() {} // XFilter @@ -102,7 +103,7 @@ throw ( ::com::sun::star::uno::RuntimeException ); throw ( ::com::sun::star::uno::RuntimeException ); ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > -SAL_CALL CDRImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) +SAL_CALL CDRImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext) throw ( ::com::sun::star::uno::Exception ); #endif diff --git a/writerperfect/source/draw/CMXImportFilter.cxx b/writerperfect/source/draw/CMXImportFilter.cxx index 76a9d06431a6..83f161bda150 100644 --- a/writerperfect/source/draw/CMXImportFilter.cxx +++ b/writerperfect/source/draw/CMXImportFilter.cxx @@ -33,7 +33,6 @@ #include <osl/diagnose.h> #include <rtl/tencinfo.h> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> @@ -42,6 +41,7 @@ #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/uno/Reference.h> +#include <comphelper/componentcontext.hxx> #include <xmloff/attrlist.hxx> #include <libcdr/libcdr.h> @@ -67,7 +67,6 @@ using com::sun::star::uno::UNO_QUERY; using com::sun::star::uno::XInterface; using com::sun::star::uno::Exception; using com::sun::star::uno::RuntimeException; -using com::sun::star::lang::XMultiServiceFactory; using com::sun::star::beans::PropertyValue; using com::sun::star::document::XFilter; using com::sun::star::document::XExtendedFilterDetection; @@ -107,7 +106,7 @@ throw (RuntimeException) // An XML import service: what we push sax messages to.. OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.XMLOasisImporter" ) ); - Reference < XDocumentHandler > xInternalHandler( mxMSF->createInstance( sXMLImportService ), UNO_QUERY ); + Reference < XDocumentHandler > xInternalHandler( comphelper::ComponentContext( mxContext ).createComponent( sXMLImportService ), UNO_QUERY ); // The XImporter sets up an empty target document for XDocumentHandler to write to.. Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY); @@ -238,13 +237,13 @@ throw (RuntimeException) #undef SERVICE_NAME2 #undef SERVICE_NAME1 -Reference< XInterface > SAL_CALL CMXImportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) +Reference< XInterface > SAL_CALL CMXImportFilter_createInstance( const Reference< XComponentContext > & rContext) throw( Exception ) { #ifdef DEBUG std::cerr << "CMXImportFilter_createInstance" << std::endl; #endif - return (cppu::OWeakObject *) new CMXImportFilter( rSMgr ); + return (cppu::OWeakObject *) new CMXImportFilter( rContext ); } // XServiceInfo diff --git a/writerperfect/source/draw/CMXImportFilter.hxx b/writerperfect/source/draw/CMXImportFilter.hxx index a9ec8f430ec5..5637bd95dae4 100644 --- a/writerperfect/source/draw/CMXImportFilter.hxx +++ b/writerperfect/source/draw/CMXImportFilter.hxx @@ -35,6 +35,7 @@ #include <com/sun/star/document/XExtendedFilterDetection.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <cppuhelper/implbase5.hxx> @@ -54,14 +55,14 @@ class CMXImportFilter : public cppu::WeakImplHelper5 { protected: // oo.org declares - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc; ::rtl::OUString msFilterName; ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler; public: - CMXImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF) - : mxMSF( rxMSF ) {} + CMXImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext) + : mxContext( rxContext ) {} virtual ~CMXImportFilter() {} // XFilter @@ -102,7 +103,7 @@ throw ( ::com::sun::star::uno::RuntimeException ); throw ( ::com::sun::star::uno::RuntimeException ); ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > -SAL_CALL CMXImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) +SAL_CALL CMXImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext) throw ( ::com::sun::star::uno::Exception ); #endif diff --git a/writerperfect/source/draw/VisioImportFilter.cxx b/writerperfect/source/draw/VisioImportFilter.cxx index 13bf08922fa7..12337dd0023a 100644 --- a/writerperfect/source/draw/VisioImportFilter.cxx +++ b/writerperfect/source/draw/VisioImportFilter.cxx @@ -33,7 +33,6 @@ #include <osl/diagnose.h> #include <rtl/tencinfo.h> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> @@ -42,6 +41,7 @@ #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/uno/Reference.h> +#include <comphelper/componentcontext.hxx> #include <xmloff/attrlist.hxx> #include <libvisio/libvisio.h> @@ -67,7 +67,6 @@ using com::sun::star::uno::UNO_QUERY; using com::sun::star::uno::XInterface; using com::sun::star::uno::Exception; using com::sun::star::uno::RuntimeException; -using com::sun::star::lang::XMultiServiceFactory; using com::sun::star::beans::PropertyValue; using com::sun::star::document::XFilter; using com::sun::star::document::XExtendedFilterDetection; @@ -107,7 +106,7 @@ throw (RuntimeException) // An XML import service: what we push sax messages to.. OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.XMLOasisImporter" ) ); - Reference < XDocumentHandler > xInternalHandler( mxMSF->createInstance( sXMLImportService ), UNO_QUERY ); + Reference < XDocumentHandler > xInternalHandler( comphelper::ComponentContext( mxContext ).createComponent( sXMLImportService ), UNO_QUERY ); // The XImporter sets up an empty target document for XDocumentHandler to write to.. Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY); @@ -238,13 +237,13 @@ throw (RuntimeException) #undef SERVICE_NAME2 #undef SERVICE_NAME1 -Reference< XInterface > SAL_CALL VisioImportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) +Reference< XInterface > SAL_CALL VisioImportFilter_createInstance( const Reference< XComponentContext > & rContext) throw( Exception ) { #ifdef DEBUG std::cerr << "VisioImportFilter_createInstance" << std::endl; #endif - return (cppu::OWeakObject *) new VisioImportFilter( rSMgr ); + return (cppu::OWeakObject *) new VisioImportFilter( rContext ); } // XServiceInfo diff --git a/writerperfect/source/draw/VisioImportFilter.hxx b/writerperfect/source/draw/VisioImportFilter.hxx index 377c007c1053..333ad527b247 100644 --- a/writerperfect/source/draw/VisioImportFilter.hxx +++ b/writerperfect/source/draw/VisioImportFilter.hxx @@ -35,6 +35,7 @@ #include <com/sun/star/document/XExtendedFilterDetection.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <cppuhelper/implbase5.hxx> @@ -54,14 +55,14 @@ class VisioImportFilter : public cppu::WeakImplHelper5 { protected: // oo.org declares - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc; ::rtl::OUString msFilterName; ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler; public: - VisioImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF) - : mxMSF( rxMSF ) {} + VisioImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext) + : mxContext( rxContext ) {} virtual ~VisioImportFilter() {} // XFilter @@ -102,7 +103,7 @@ throw ( ::com::sun::star::uno::RuntimeException ); throw ( ::com::sun::star::uno::RuntimeException ); ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > -SAL_CALL VisioImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) +SAL_CALL VisioImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext) throw ( ::com::sun::star::uno::Exception ); #endif diff --git a/writerperfect/source/draw/WPGImportFilter.cxx b/writerperfect/source/draw/WPGImportFilter.cxx index ff7612b1e433..4c6586bb3ded 100644 --- a/writerperfect/source/draw/WPGImportFilter.cxx +++ b/writerperfect/source/draw/WPGImportFilter.cxx @@ -33,7 +33,6 @@ #include <osl/diagnose.h> #include <rtl/tencinfo.h> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> @@ -42,6 +41,7 @@ #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/uno/Reference.h> +#include <comphelper/componentcontext.hxx> #include <xmloff/attrlist.hxx> #include "filter/DocumentHandler.hxx" @@ -66,7 +66,6 @@ using com::sun::star::uno::UNO_QUERY; using com::sun::star::uno::XInterface; using com::sun::star::uno::Exception; using com::sun::star::uno::RuntimeException; -using com::sun::star::lang::XMultiServiceFactory; using com::sun::star::beans::PropertyValue; using com::sun::star::document::XFilter; using com::sun::star::document::XExtendedFilterDetection; @@ -106,7 +105,7 @@ throw (RuntimeException) // An XML import service: what we push sax messages to.. OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.XMLOasisImporter" ) ); - Reference < XDocumentHandler > xInternalHandler( mxMSF->createInstance( sXMLImportService ), UNO_QUERY ); + Reference < XDocumentHandler > xInternalHandler( comphelper::ComponentContext( mxContext ).createComponent( sXMLImportService ), UNO_QUERY ); // The XImporter sets up an empty target document for XDocumentHandler to write to.. Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY); @@ -237,13 +236,13 @@ throw (RuntimeException) #undef SERVICE_NAME2 #undef SERVICE_NAME1 -Reference< XInterface > SAL_CALL WPGImportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) +Reference< XInterface > SAL_CALL WPGImportFilter_createInstance( const Reference< XComponentContext > & rContext) throw( Exception ) { #ifdef DEBUG std::cerr << "WPGImportFilter_createInstance" << std::endl; #endif - return (cppu::OWeakObject *) new WPGImportFilter( rSMgr ); + return (cppu::OWeakObject *) new WPGImportFilter( rContext ); } // XServiceInfo diff --git a/writerperfect/source/draw/WPGImportFilter.hxx b/writerperfect/source/draw/WPGImportFilter.hxx index 091c821a552b..1f3367fc562d 100644 --- a/writerperfect/source/draw/WPGImportFilter.hxx +++ b/writerperfect/source/draw/WPGImportFilter.hxx @@ -35,6 +35,7 @@ #include <com/sun/star/document/XExtendedFilterDetection.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <cppuhelper/implbase5.hxx> @@ -54,14 +55,14 @@ class WPGImportFilter : public cppu::WeakImplHelper5 { protected: // oo.org declares - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc; ::rtl::OUString msFilterName; ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler; public: - WPGImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF) - : mxMSF( rxMSF ) {} + WPGImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext) + : mxContext( rxContext ) {} virtual ~WPGImportFilter() {} // XFilter @@ -102,7 +103,7 @@ throw ( ::com::sun::star::uno::RuntimeException ); throw ( ::com::sun::star::uno::RuntimeException ); ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > -SAL_CALL WPGImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) +SAL_CALL WPGImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext) throw ( ::com::sun::star::uno::Exception ); #endif diff --git a/writerperfect/source/draw/wpftdraw_genericfilter.cxx b/writerperfect/source/draw/wpftdraw_genericfilter.cxx index cbecb4faeb2d..fdfe1efae827 100644 --- a/writerperfect/source/draw/wpftdraw_genericfilter.cxx +++ b/writerperfect/source/draw/wpftdraw_genericfilter.cxx @@ -23,88 +23,43 @@ /* "This product is not manufactured, approved, or supported by * Corel Corporation or Corel Corporation Limited." */ -#include <stdio.h> -#include <osl/mutex.hxx> -#include <osl/thread.h> -#include <cppuhelper/factory.hxx> +#include "sal/config.h" -#include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include "cppuhelper/factory.hxx" +#include "cppuhelper/implementationentry.hxx" +#include "sal/types.h" #include "CDRImportFilter.hxx" #include "CMXImportFilter.hxx" #include "VisioImportFilter.hxx" #include "WPGImportFilter.hxx" -using namespace ::rtl; -using namespace ::cppu; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::registry; +namespace { -extern "C" -{ - SAL_DLLPUBLIC_EXPORT void *SAL_CALL wpftdraw_component_getFactory( - const sal_Char *pImplName, void *pServiceManager, void * /* pRegistryKey */ ) - { - void *pRet = 0; - - OUString implName = OUString::createFromAscii( pImplName ); - if ( pServiceManager && implName.equals(CDRImportFilter_getImplementationName()) ) - { - Reference< XSingleServiceFactory > xFactory( createSingleFactory( - reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), - OUString::createFromAscii( pImplName ), - CDRImportFilter_createInstance, CDRImportFilter_getSupportedServiceNames() ) ); - - if (xFactory.is()) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - } - if ( pServiceManager && implName.equals(CMXImportFilter_getImplementationName()) ) - { - Reference< XSingleServiceFactory > xFactory( createSingleFactory( - reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), - OUString::createFromAscii( pImplName ), - CMXImportFilter_createInstance, CMXImportFilter_getSupportedServiceNames() ) ); - - if (xFactory.is()) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - } - if ( pServiceManager && implName.equals(WPGImportFilter_getImplementationName()) ) - { - Reference< XSingleServiceFactory > xFactory( createSingleFactory( - reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), - OUString::createFromAscii( pImplName ), - WPGImportFilter_createInstance, WPGImportFilter_getSupportedServiceNames() ) ); +static cppu::ImplementationEntry const services[] = { + { &CDRImportFilter_createInstance, &CDRImportFilter_getImplementationName, + &CDRImportFilter_getSupportedServiceNames, + &cppu::createSingleComponentFactory, 0, 0 }, + { &CMXImportFilter_createInstance, &CMXImportFilter_getImplementationName, + &CMXImportFilter_getSupportedServiceNames, + &cppu::createSingleComponentFactory, 0, 0 }, + { &VisioImportFilter_createInstance, + &VisioImportFilter_getImplementationName, + &VisioImportFilter_getSupportedServiceNames, + &cppu::createSingleComponentFactory, 0, 0 }, + { &WPGImportFilter_createInstance, &WPGImportFilter_getImplementationName, + &WPGImportFilter_getSupportedServiceNames, + &cppu::createSingleComponentFactory, 0, 0 }, + { 0, 0, 0, 0, 0, 0 } }; - if (xFactory.is()) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - } - if ( pServiceManager && implName.equals(VisioImportFilter_getImplementationName()) ) - { - Reference< XSingleServiceFactory > xFactory( createSingleFactory( - reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), - OUString::createFromAscii( pImplName ), - VisioImportFilter_createInstance, VisioImportFilter_getSupportedServiceNames() ) ); - - if (xFactory.is()) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - } +} - return pRet; - } +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL wpftdraw_component_getFactory( + char const * pImplName, void * pServiceManager, void * pRegistryKey) +{ + return cppu::component_getFactoryHelper( + pImplName, pServiceManager, pRegistryKey, services); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |