diff --git a/sw/source/core/inc/unofreg.hxx b/sw/source/core/inc/unofreg.hxx index 3e6a1f3a396b..0b49ffd9bc90 100644 --- a/sw/source/core/inc/unofreg.hxx +++ b/sw/source/core/inc/unofreg.hxx @@ -38,12 +38,6 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL SwUnoModule_createInstance( css::uno::Sequence< OUString > SAL_CALL SwTextDocument_getSupportedServiceNames() throw(); OUString SAL_CALL SwTextDocument_getImplementationName() throw(); css::uno::Reference< css::uno::XInterface > SAL_CALL SwTextDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > &rSMgr, const sal_uInt64 _nCreationFlags ) throw( css::uno::Exception ); -css::uno::Sequence< OUString > SAL_CALL SwWebDocument_getSupportedServiceNames() throw(); -OUString SAL_CALL SwWebDocument_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL SwWebDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > &rSMgr ) throw( css::uno::Exception ); -css::uno::Sequence< OUString > SAL_CALL SwGlobalDocument_getSupportedServiceNames() throw(); -OUString SAL_CALL SwGlobalDocument_getImplementationName() throw(); -css::uno::Reference< css::uno::XInterface > SAL_CALL SwGlobalDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > &rSMgr ) throw( css::uno::Exception ); //API objects css::uno::Sequence< OUString > SAL_CALL SwXAutoTextContainer_getSupportedServiceNames() throw(); diff --git a/sw/source/uibase/uno/unodoc.cxx b/sw/source/uibase/uno/unodoc.cxx index 41189d2c4c41..2f4291bd60e6 100644 --- a/sw/source/uibase/uno/unodoc.cxx +++ b/sw/source/uibase/uno/unodoc.cxx @@ -26,6 +26,7 @@ #include "wdocsh.hxx" #include #include +#include using namespace ::com::sun::star; @@ -57,58 +58,29 @@ uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance( return uno::Reference< uno::XInterface >( pShell->GetModel() ); } -// com.sun.star.comp.Writer.WebDocument - -uno::Sequence< OUString > SAL_CALL SwWebDocument_getSupportedServiceNames() throw() -{ - // return only top level services here! All others must be - // resolved by rtti! - uno::Sequence< OUString > aRet ( 1 ); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.WebDocument"; - - return aRet; -} - -OUString SAL_CALL SwWebDocument_getImplementationName() throw() -{ - return OUString( "com.sun.star.comp.Writer.WebDocument" ); -} - -uno::Reference< uno::XInterface > SAL_CALL SwWebDocument_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & ) - throw( uno::Exception ) +extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL +com_sun_star_comp_Writer_WebDocument_get_implementation(::com::sun::star::uno::XComponentContext*, + ::com::sun::star::uno::Sequence const &) { SolarMutexGuard aGuard; SwGlobals::ensure(); SfxObjectShell* pShell = new SwWebDocShell( SFX_CREATE_MODE_STANDARD ); - return uno::Reference< uno::XInterface >( pShell->GetModel() ); + uno::Reference< uno::XInterface > model( pShell->GetModel() ); + model->acquire(); + return model.get(); } -// com.sun.star.comp.Writer.GlobalDocument -uno::Sequence< OUString > SAL_CALL SwGlobalDocument_getSupportedServiceNames() throw() -{ - uno::Sequence< OUString > aRet ( 1 ); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.GlobalDocument"; - - return aRet; -} - -OUString SAL_CALL SwGlobalDocument_getImplementationName() throw() -{ - return OUString( "com.sun.star.comp.Writer.GlobalDocument" ); -} - -uno::Reference< uno::XInterface > SAL_CALL SwGlobalDocument_createInstance( - const uno::Reference< lang::XMultiServiceFactory > &) - throw( uno::Exception ) +extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL +com_sun_star_comp_Writer_GlobalDocument_get_implementation(::com::sun::star::uno::XComponentContext*, + ::com::sun::star::uno::Sequence const &) { SolarMutexGuard aGuard; SwGlobals::ensure(); SfxObjectShell* pShell = new SwGlobalDocShell( SFX_CREATE_MODE_STANDARD ); - return uno::Reference< uno::XInterface >( pShell->GetModel() ); + uno::Reference< uno::XInterface > model( pShell->GetModel() ); + model->acquire(); + return model.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/uno/unofreg.cxx b/sw/source/uibase/uno/unofreg.cxx index 84105c12e415..c5b2138c0623 100644 --- a/sw/source/uibase/uno/unofreg.cxx +++ b/sw/source/uibase/uno/unofreg.cxx @@ -102,22 +102,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sw_component_getFactory( SwTextDocument_createInstance, SwTextDocument_getSupportedServiceNames() ); } - else if( SwWebDocument_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwWebDocument_getImplementationName(), - SwWebDocument_createInstance, - SwWebDocument_getSupportedServiceNames() ); - } - else if( SwGlobalDocument_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwGlobalDocument_getImplementationName(), - SwGlobalDocument_createInstance, - SwGlobalDocument_getSupportedServiceNames() ); - } else if( SwUnoModule_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) ) { diff --git a/sw/util/sw.component b/sw/util/sw.component index 81baa5f0aa71..0b75e6776618 100644 --- a/sw/util/sw.component +++ b/sw/util/sw.component @@ -31,13 +31,15 @@ - + - +