diff options
-rw-r--r-- | sw/source/filter/ww8/rtfexportfilter.cxx | 89 | ||||
-rwxr-xr-x | sw/util/msword.map | 3 |
2 files changed, 92 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: */ diff --git a/sw/util/msword.map b/sw/util/msword.map index 16b9d25b0b78..d2a9d9b4f7e1 100755 --- a/sw/util/msword.map +++ b/sw/util/msword.map @@ -6,6 +6,9 @@ UDK_3_0_0 { ExportDOC; SaveOrDelMSVBAStorage_ww8; GetSaveWarningOfMSVBAStorage_ww8; + component_getImplementationEnvironment; + component_writeInfo; + component_getFactory; local: *; }; |