diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-07-04 09:05:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-05 10:20:16 +0200 |
commit | a2d844ca71fa013001b291d42dc5f00b0c1124c0 (patch) | |
tree | 1d295dab3372f1932ce24552747c056a38f8255d /basctl/source/basicide/unomodel.cxx | |
parent | 99d4bf9446c392c3cf2877219c78917ca4d5dd87 (diff) |
basctl: create instances with uno constructors
See tdf#74608 for motivation
Change-Id: Ibada6b9b7e6c754487c90ce1a37c17019db55370
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97932
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl/source/basicide/unomodel.cxx')
-rw-r--r-- | basctl/source/basicide/unomodel.cxx | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/basctl/source/basicide/unomodel.cxx b/basctl/source/basicide/unomodel.cxx index 8c559cccb5b2..f22634935fcc 100644 --- a/basctl/source/basicide/unomodel.cxx +++ b/basctl/source/basicide/unomodel.cxx @@ -80,11 +80,6 @@ uno::Sequence< uno::Type > SAL_CALL SIDEModel::getTypes( ) OUString SIDEModel::getImplementationName() { - return getImplementationName_Static(); -} - -OUString SIDEModel::getImplementationName_Static() -{ return "com.sun.star.comp.basic.BasicIDE"; } @@ -92,25 +87,12 @@ sal_Bool SIDEModel::supportsService(const OUString& rServiceName) { return cppu::supportsService(this, rServiceName); } -uno::Sequence< OUString > SIDEModel::getSupportedServiceNames() -{ - return getSupportedServiceNames_Static(); -} -uno::Sequence< OUString > SIDEModel::getSupportedServiceNames_Static() +uno::Sequence< OUString > SIDEModel::getSupportedServiceNames() { return { "com.sun.star.script.BasicIDE" }; } -uno::Reference< uno::XInterface > SIDEModel_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & ) -{ - SolarMutexGuard aGuard; - EnsureIde(); - SfxObjectShell* pShell = new DocShell(); - return uno::Reference< uno::XInterface >( pShell->GetModel() ); -} - // XStorable void SAL_CALL SIDEModel::store() { @@ -135,4 +117,16 @@ void SIDEModel::notImplemented() } // namespace basctl +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_basic_BasicID_get_implementation( + css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&) +{ + SolarMutexGuard aGuard; + basctl::EnsureIde(); + SfxObjectShell* pShell = new basctl::DocShell(); + auto pModel = pShell->GetModel(); + pModel->acquire(); + return pModel.get(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |