diff options
author | Chris Sherlock <chris.sherlock@collabora.com> | 2015-02-24 02:07:17 +1100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-02-26 14:20:01 +0100 |
commit | 80bcdb1e4fb8ad8d58d47afb5d07845cf90679cb (patch) | |
tree | f947c1fec89e11998b8dedc24f3de09f5fabc1c6 /sw/source/uibase/uno/unodoc.cxx | |
parent | f3cffeb3aeb67e979d43bb4b8e970cc466b14d45 (diff) |
sw: convert SwWebDocument & SwGlobalDocument components to use constructor
Change-Id: Ib59fa91eb9d32ea437c182d3c0f3b9348816bf7b
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/source/uibase/uno/unodoc.cxx')
-rw-r--r-- | sw/source/uibase/uno/unodoc.cxx | 54 |
1 files changed, 13 insertions, 41 deletions
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 <osl/mutex.hxx> #include <vcl/svapp.hxx> +#include <cppuhelper/weak.hxx> 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<css::uno::Any> const &) { SolarMutexGuard aGuard; SwGlobals::ensure(); SfxObjectShell* pShell = new SwWebDocShell( SFX_CREATE_MODE_STANDARD ); - return uno::Reference< uno::XInterface >( pShell->GetModel() ); -} - -// 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; + uno::Reference< uno::XInterface > model( pShell->GetModel() ); + model->acquire(); + return model.get(); } -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<css::uno::Any> 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: */ |