summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/rtfexportfilter.cxx
diff options
context:
space:
mode:
authoros <os@openoffice.org>2010-09-02 16:05:08 +0200
committeros <os@openoffice.org>2010-09-02 16:05:08 +0200
commitc8f46a1dc17c9f7a38dafd66b924a750e2ad0e4b (patch)
tree9f8e3fb230cf1e2e9e247664d5743322f2e0a5f5 /sw/source/filter/ww8/rtfexportfilter.cxx
parentcb00949c460eb4a0b32d72f97d1abf812838d831 (diff)
component_* methods moved and exported
Diffstat (limited to 'sw/source/filter/ww8/rtfexportfilter.cxx')
-rw-r--r--sw/source/filter/ww8/rtfexportfilter.cxx89
1 files changed, 89 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx b/sw/source/filter/ww8/rtfexportfilter.cxx
index 01e1de7d5e01..c6050476fe28 100644
--- a/sw/source/filter/ww8/rtfexportfilter.cxx
+++ b/sw/source/filter/ww8/rtfexportfilter.cxx
@@ -132,5 +132,94 @@ uno::Reference< uno::XInterface > SAL_CALL RtfExport_createInstance(const uno::R
{
return (cppu::OWeakObject*) new RtfExportFilter( rSMgr );
}
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
+{
+ sal_Bool bRet = sal_False;
+
+ if( pRegistryKey )
+ {
+ try
+ {
+ uno::Reference< registry::XRegistryKey > xNewKey1(
+ static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
+ OUString::createFromAscii( IMPL_NAME_RTFEXPORT "/UNO/SERVICES/" ) ) );
+ xNewKey1->createKey( RtfExport_getSupportedServiceNames().getConstArray()[0] );
+
+ bRet = sal_True;
+ }
+ catch( registry::InvalidRegistryException& )
+ {
+ OSL_ENSURE( sal_False, "### InvalidRegistryException (rtfexport)!" );
+ }
+
+// try
+// {
+// uno::Reference< registry::XRegistryKey > xNewKey1(
+// static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
+// OUString::createFromAscii( IMPL_NAME_RTFIMPORT "/UNO/SERVICES/" ) ) );
+// xNewKey1->createKey( RtfExport_getSupportedServiceNames().getConstArray()[0] );
+
+// bRet = sal_True;
+// }
+// catch( registry::InvalidRegistryException& )
+// {
+// OSL_ENSURE( sal_False, "### InvalidRegistryException (rtfimport)!" );
+// }
+ }
+
+ return bRet;
+}
+
+// ------------------------
+// - component_getFactory -
+// ------------------------
+
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
+{
+ OSL_TRACE("%s, pImplName is '%s'", OSL_THIS_FUNC, pImplName);
+ uno::Reference< lang::XSingleServiceFactory > xFactory;
+ void* pRet = 0;
+
+ if ( rtl_str_compare( pImplName, IMPL_NAME_RTFEXPORT ) == 0 ) {
+ const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFEXPORT ) );
+
+ xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
+ reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
+ RtfExport_getImplementationName(),
+ RtfExport_createInstance,
+ RtfExport_getSupportedServiceNames() ) );
+ }
+// else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFIMPORT ) == 0 ) {
+// const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFIMPORT ) );
+
+// xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
+// reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
+// RtfImport_getImplementationName(),
+// RtfImport_createInstance,
+// RtfImport_getSupportedServiceNames() ) );
+// }
+
+ if ( xFactory.is() )
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+
+ return pRet;
+}
+
+#ifdef __cplusplus
+}
+#endif
/* vi:set shiftwidth=4 expandtab: */