sw: convert SwWebDocument & SwGlobalDocument components to use constructor
Change-Id: Ib59fa91eb9d32ea437c182d3c0f3b9348816bf7b Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
committed by
Stephan Bergmann
parent
f3cffeb3ae
commit
80bcdb1e4f
@@ -38,12 +38,6 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL SwUnoModule_createInstance(
|
|||||||
css::uno::Sequence< OUString > SAL_CALL SwTextDocument_getSupportedServiceNames() throw();
|
css::uno::Sequence< OUString > SAL_CALL SwTextDocument_getSupportedServiceNames() throw();
|
||||||
OUString SAL_CALL SwTextDocument_getImplementationName() 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::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
|
//API objects
|
||||||
css::uno::Sequence< OUString > SAL_CALL SwXAutoTextContainer_getSupportedServiceNames() throw();
|
css::uno::Sequence< OUString > SAL_CALL SwXAutoTextContainer_getSupportedServiceNames() throw();
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include "wdocsh.hxx"
|
#include "wdocsh.hxx"
|
||||||
#include <osl/mutex.hxx>
|
#include <osl/mutex.hxx>
|
||||||
#include <vcl/svapp.hxx>
|
#include <vcl/svapp.hxx>
|
||||||
|
#include <cppuhelper/weak.hxx>
|
||||||
|
|
||||||
using namespace ::com::sun::star;
|
using namespace ::com::sun::star;
|
||||||
|
|
||||||
@@ -57,58 +58,29 @@ uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance(
|
|||||||
return uno::Reference< uno::XInterface >( pShell->GetModel() );
|
return uno::Reference< uno::XInterface >( pShell->GetModel() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// com.sun.star.comp.Writer.WebDocument
|
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*,
|
||||||
uno::Sequence< OUString > SAL_CALL SwWebDocument_getSupportedServiceNames() throw()
|
::com::sun::star::uno::Sequence<css::uno::Any> const &)
|
||||||
{
|
|
||||||
// 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 )
|
|
||||||
{
|
{
|
||||||
SolarMutexGuard aGuard;
|
SolarMutexGuard aGuard;
|
||||||
SwGlobals::ensure();
|
SwGlobals::ensure();
|
||||||
SfxObjectShell* pShell = new SwWebDocShell( SFX_CREATE_MODE_STANDARD );
|
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()
|
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*,
|
||||||
uno::Sequence< OUString > aRet ( 1 );
|
::com::sun::star::uno::Sequence<css::uno::Any> const &)
|
||||||
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 )
|
|
||||||
{
|
{
|
||||||
SolarMutexGuard aGuard;
|
SolarMutexGuard aGuard;
|
||||||
SwGlobals::ensure();
|
SwGlobals::ensure();
|
||||||
SfxObjectShell* pShell = new SwGlobalDocShell( SFX_CREATE_MODE_STANDARD );
|
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: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -102,22 +102,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sw_component_getFactory(
|
|||||||
SwTextDocument_createInstance,
|
SwTextDocument_createInstance,
|
||||||
SwTextDocument_getSupportedServiceNames() );
|
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(
|
else if( SwUnoModule_getImplementationName().equalsAsciiL(
|
||||||
pImplName, nImplNameLen ) )
|
pImplName, nImplNameLen ) )
|
||||||
{
|
{
|
||||||
|
@@ -31,13 +31,15 @@
|
|||||||
<implementation name="com.sun.star.comp.Writer.FilterOptionsDialog">
|
<implementation name="com.sun.star.comp.Writer.FilterOptionsDialog">
|
||||||
<service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/>
|
<service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
<implementation name="com.sun.star.comp.Writer.GlobalDocument">
|
<implementation name="com.sun.star.comp.Writer.GlobalDocument"
|
||||||
|
constructor="com_sun_star_comp_Writer_GlobalDocument_get_implementation">
|
||||||
<service name="com.sun.star.text.GlobalDocument"/>
|
<service name="com.sun.star.text.GlobalDocument"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
<implementation name="com.sun.star.comp.Writer.TextDocument">
|
<implementation name="com.sun.star.comp.Writer.TextDocument">
|
||||||
<service name="com.sun.star.text.TextDocument"/>
|
<service name="com.sun.star.text.TextDocument"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
<implementation name="com.sun.star.comp.Writer.WebDocument">
|
<implementation name="com.sun.star.comp.Writer.WebDocument"
|
||||||
|
constructor="com_sun_star_comp_Writer_WebDocument_get_implementation">
|
||||||
<service name="com.sun.star.text.WebDocument"/>
|
<service name="com.sun.star.text.WebDocument"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
<implementation name="com.sun.star.comp.Writer.WriterModule">
|
<implementation name="com.sun.star.comp.Writer.WriterModule">
|
||||||
|
Reference in New Issue
Block a user