[Libreoffice-commits] core.git: framework/source framework/util
framework/source/accelerators/globalacceleratorconfiguration.cxx | 20 +- framework/util/fwk.component |3 + 2 files changed, 5 insertions(+), 18 deletions(-) New commits: commit dfc3f0b640710b144479b65b8394ed29f96138fd Author: Noel Grandin AuthorDate: Sun Mar 21 18:38:02 2021 +0200 Commit: Noel Grandin CommitDate: Mon Mar 22 16:05:21 2021 +0100 use single-use attribute for GlobalAcceleratorConfiguration instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I13161282ebefb47923a34a71fd66d64106d00c78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112853 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/accelerators/globalacceleratorconfiguration.cxx b/framework/source/accelerators/globalacceleratorconfiguration.cxx index 359fbcd5be42..e54a05a03be3 100644 --- a/framework/source/accelerators/globalacceleratorconfiguration.cxx +++ b/framework/source/accelerators/globalacceleratorconfiguration.cxx @@ -109,22 +109,6 @@ void GlobalAcceleratorConfiguration::fillCache() {} } -struct Instance -{ -explicit Instance(css::uno::Reference const & context) -: instance(new GlobalAcceleratorConfiguration(context)) -{ -instance->fillCache(); -} - -rtl::Reference instance; -}; - -struct Singleton: -public rtl::StaticWithArg< -Instance, css::uno::Reference, Singleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -132,7 +116,9 @@ com_sun_star_comp_framework_GlobalAcceleratorConfiguration_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast(Singleton::get(context).instance.get())); +rtl::Reference xGAC = new GlobalAcceleratorConfiguration(context); +xGAC->fillCache(); +return cppu::acquire(xGAC.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index d695aef4841a..bb74eb817d12 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -55,7 +55,8 @@ + constructor="com_sun_star_comp_framework_GlobalAcceleratorConfiguration_get_implementation" + single-instance="true"> https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/services/pathsettings.cxx | 27 ++- framework/util/fwk.component |3 ++- 2 files changed, 8 insertions(+), 22 deletions(-) New commits: commit cd596ebc8ecc1ac303c4c3481c541cb52afa32bb Author: Noel Grandin AuthorDate: Sun Mar 21 13:25:15 2021 +0200 Commit: Noel Grandin CommitDate: Mon Mar 22 16:05:07 2021 +0100 use single-use attribute for PathSettings instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I90f7e0af8ce67cdcef2df7b28c7e55b1c92aad3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112834 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx index c59ef728ccb5..b58091294231 100644 --- a/framework/source/services/pathsettings.cxx +++ b/framework/source/services/pathsettings.cxx @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -1409,25 +1410,6 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgNew() return xCfg; } -struct Instance { -explicit Instance( -css::uno::Reference const & context): -instance( -static_cast(new PathSettings(context))) -{ -// fill cache -static_cast(static_cast -(instance.get()))->impl_readAll(); -} - -css::uno::Reference instance; -}; - -struct Singleton: -public rtl::StaticWithArg< -Instance, css::uno::Reference, Singleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -1435,8 +1417,11 @@ com_sun_star_comp_framework_PathSettings_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -Singleton::get(context).instance.get())); +rtl::Reference xPathSettings = new PathSettings(context); +// fill cache +xPathSettings->impl_readAll(); + +return cppu::acquire(xPathSettings.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index c20c9a30c0e2..d695aef4841a 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -104,7 +104,8 @@ + constructor="com_sun_star_comp_framework_PathSettings_get_implementation" + single-instance="true"> ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/jobs/jobexecutor.cxx | 25 - framework/util/fwk.component |3 ++- 2 files changed, 6 insertions(+), 22 deletions(-) New commits: commit 1d7cc199faf8b9ccf92926da6a60c99fac063fa5 Author: Noel Grandin AuthorDate: Sun Mar 21 18:36:07 2021 +0200 Commit: Noel Grandin CommitDate: Mon Mar 22 11:58:00 2021 +0100 use single-use attribute for JobExecutor instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I33e8fa15eda12b326beaede61065a84d236b8154 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112852 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx index 30b90cca6ec4..5578b877b028 100644 --- a/framework/source/jobs/jobexecutor.cxx +++ b/framework/source/jobs/jobexecutor.cxx @@ -383,25 +383,6 @@ void SAL_CALL JobExecutor::disposing( const css::lang::EventObject& aEvent ) /* } SAFE */ } -struct Instance { -explicit Instance( -css::uno::Reference const & context): -instance( -static_cast(new JobExecutor(context))) -{ -// 2nd phase initialization needed -static_cast(static_cast -(instance.get()))->initListeners(); -} - -rtl::Reference instance; -}; - -struct Singleton: -public rtl::StaticWithArg< -Instance, css::uno::Reference, Singleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -409,8 +390,10 @@ com_sun_star_comp_framework_JobExecutor_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -Singleton::get(context).instance.get())); +rtl::Reference xJobExec = new JobExecutor(context); +// 2nd phase initialization needed +xJobExec->initListeners(); +return cppu::acquire(xJobExec.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index aad750e76c72..c20c9a30c0e2 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -63,7 +63,8 @@ + constructor="com_sun_star_comp_framework_JobExecutor_get_implementation" + single-instance="true"> ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/services/autorecovery.cxx | 26 +- framework/util/fwk.component |3 ++- 2 files changed, 7 insertions(+), 22 deletions(-) New commits: commit bc22a790b951da3364daa8f7c45dfc9547a8f717 Author: Noel Grandin AuthorDate: Sun Mar 21 18:33:44 2021 +0200 Commit: Noel Grandin CommitDate: Mon Mar 22 11:57:46 2021 +0100 use single-use attribute for AutoRecovery instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I53c722e4126f5386b3cd43eee09ccfe4656ebd9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112851 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index bdc46b1d73d4..085b627f5794 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -4219,25 +4219,6 @@ void AutoRecovery::st_impl_removeLockFile() } } -struct Instance { -explicit Instance( -css::uno::Reference const & context): -instance( -static_cast(new AutoRecovery(context))) -{ -// 2nd phase initialization needed -static_cast(static_cast -(instance.get()))->initListeners(); -} - -css::uno::Reference instance; -}; - -struct Singleton: -public rtl::StaticWithArg< -Instance, css::uno::Reference, Singleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -4245,8 +4226,11 @@ com_sun_star_comp_framework_AutoRecovery_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -Singleton::get(context).instance.get())); +rtl::Reference xAutoRecovery = new AutoRecovery(context); +// 2nd phase initialization needed +xAutoRecovery->initListeners(); + +return cppu::acquire(xAutoRecovery.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index cc5fcfb13faa..aad750e76c72 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -28,7 +28,8 @@ + constructor="com_sun_star_comp_framework_AutoRecovery_get_implementation" + single-instance="true"> ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/services/taskcreatorsrv.cxx | 19 +-- framework/util/fwk.component |3 ++- 2 files changed, 3 insertions(+), 19 deletions(-) New commits: commit a95abea894d098de8338b4138c76c28efe42d056 Author: Noel Grandin AuthorDate: Sun Mar 21 13:20:12 2021 +0200 Commit: Noel Grandin CommitDate: Sun Mar 21 18:00:49 2021 +0100 use single-use attribute for TaskCreatorService instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I0ebf3a71c93015850eb34c8cbe9395b6d36ce3c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112832 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index b66a9dc3ac2d..856d440230b6 100644 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx @@ -349,22 +349,6 @@ OUString TaskCreatorService::impl_filterNames( const OUString& sName ) return sFiltered; } -struct Instance { -explicit Instance( -css::uno::Reference const & context): -instance( -static_cast(new TaskCreatorService(context))) -{ -} - -css::uno::Reference instance; -}; - -struct Singleton: -public rtl::StaticWithArg< -Instance, css::uno::Reference, Singleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -372,8 +356,7 @@ com_sun_star_comp_framework_TaskCreator_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -Singleton::get(context).instance.get())); +return cppu::acquire(new TaskCreatorService(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index d6434cec85dd..cc5fcfb13faa 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -144,7 +144,8 @@ + constructor="com_sun_star_comp_framework_TaskCreator_get_implementation" + single-instance="true"> https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/services/modulemanager.cxx | 18 +- framework/util/fwk.component|3 ++- 2 files changed, 3 insertions(+), 18 deletions(-) New commits: commit f86e20fa4aa425fbc4e97cccdfa3080422a6584b Author: Noel Grandin AuthorDate: Sun Mar 21 13:27:05 2021 +0200 Commit: Noel Grandin CommitDate: Sun Mar 21 17:30:16 2021 +0100 use single-use attribute for ModuleManager instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I80ee080d4b62065dadc9c406485a81433a38ffaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112841 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/services/modulemanager.cxx b/framework/source/services/modulemanager.cxx index ad98644bb0b7..c03bf2611ecd 100644 --- a/framework/source/services/modulemanager.cxx +++ b/framework/source/services/modulemanager.cxx @@ -336,21 +336,6 @@ OUString ModuleManager::implts_identify(const css::uno::Reference< css::uno::XIn return OUString(); } -struct Instance { -explicit Instance( -css::uno::Reference const & context): -instance(static_cast(new ModuleManager(context))) -{ -} - -css::uno::Reference instance; -}; - -struct Singleton: -public rtl::StaticWithArg< -Instance, css::uno::Reference, Singleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -358,8 +343,7 @@ com_sun_star_comp_framework_ModuleManager_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -Singleton::get(context).instance.get())); +return cppu::acquire(new ModuleManager(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 4cbf51e97228..d6434cec85dd 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -83,7 +83,8 @@ + constructor="com_sun_star_comp_framework_ModuleManager_get_implementation" + single-instance="true"> https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/services/substitutepathvars.cxx | 19 +-- framework/util/fwk.component |3 ++- 2 files changed, 3 insertions(+), 19 deletions(-) New commits: commit b4ec5a94bd84017eb7db0b7f23d60265bbb9b040 Author: Noel Grandin AuthorDate: Sun Mar 21 13:22:22 2021 +0200 Commit: Noel Grandin CommitDate: Sun Mar 21 15:44:34 2021 +0100 use single-use attribute for SubstitutePathVariables instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I1b488ce343063b9f07d76d9dec2e12bd153c942a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112833 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index f5f7b71ffe61..2a3cb4994fc6 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -687,22 +687,6 @@ void SubstitutePathVariables::SetPredefinedPathVariables() m_aPreDefVars.m_FixedVar[ PREDEFVAR_TEMP ] = aTmp; } -struct Instance { -explicit Instance( -css::uno::Reference const & context): -instance( -static_cast(new SubstitutePathVariables(context))) -{ -} - -css::uno::Reference instance; -}; - -struct Singleton: -public rtl::StaticWithArg< -Instance, css::uno::Reference, Singleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -710,8 +694,7 @@ com_sun_star_comp_framework_PathSubstitution_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -Singleton::get(context).instance.get())); +return cppu::acquire(new SubstitutePathVariables(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 10a07911ab1b..4cbf51e97228 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -106,7 +106,8 @@ + constructor="com_sun_star_comp_framework_PathSubstitution_get_implementation" + single-instance="true"> https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/uifactory/uicontrollerfactory.cxx | 21 + framework/util/fwk.component |3 ++- 2 files changed, 3 insertions(+), 21 deletions(-) New commits: commit 918dc4c2050ff0e1e95d0dfc2c8db3a376161f16 Author: Noel AuthorDate: Thu Mar 18 11:20:50 2021 +0200 Commit: Noel Grandin CommitDate: Sat Mar 20 16:50:15 2021 +0100 use single-use attribute for StatusBarControllerFactory instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: Ifec5f54633508aa66492599caf80ed2bf3d7cbe5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112683 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/uifactory/uicontrollerfactory.cxx b/framework/source/uifactory/uicontrollerfactory.cxx index 493d1d5522d0..4b5d36948bc3 100644 --- a/framework/source/uifactory/uicontrollerfactory.cxx +++ b/framework/source/uifactory/uicontrollerfactory.cxx @@ -315,24 +315,6 @@ StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XCompon { } -struct StatusbarControllerFactoryInstance { -explicit StatusbarControllerFactoryInstance( -css::uno::Reference const & context): -instance(static_cast( -new StatusbarControllerFactory(context))) -{ -} - -css::uno::Reference instance; -}; - -struct StatusbarControllerFactorySingleton: -public rtl::StaticWithArg< -StatusbarControllerFactoryInstance, -css::uno::Reference, -StatusbarControllerFactorySingleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -356,8 +338,7 @@ com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -StatusbarControllerFactorySingleton::get(context).instance.get())); +return cppu::acquire(new StatusbarControllerFactory(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 5c9085759b19..10a07911ab1b 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -128,7 +128,8 @@ + constructor="com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation" + single-instance="true"> ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/uiconfiguration/uicategorydescription.cxx | 19 - framework/util/fwk.component |3 +- 2 files changed, 3 insertions(+), 19 deletions(-) New commits: commit 8a6887717f4f667ff3621e98379e62e0d57a4a3a Author: Noel AuthorDate: Thu Mar 18 11:28:45 2021 +0200 Commit: Noel Grandin CommitDate: Sat Mar 20 09:30:20 2021 +0100 use single-use attribute for UICategoryDescription instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: Ie6c8f76b88f1e059b81b28a40343a2207531b0d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112688 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/uiconfiguration/uicategorydescription.cxx b/framework/source/uiconfiguration/uicategorydescription.cxx index 279b8b7fd192..218032c5238e 100644 --- a/framework/source/uiconfiguration/uicategorydescription.cxx +++ b/framework/source/uiconfiguration/uicategorydescription.cxx @@ -381,22 +381,6 @@ UICategoryDescription::UICategoryDescription( const Reference< XComponentContext impl_fillElements("ooSetupFactoryCmdCategoryConfigRef"); } -struct Instance { -explicit Instance( -css::uno::Reference const & context): -instance(static_cast( -new UICategoryDescription(context))) -{ -} - -css::uno::Reference instance; -}; - -struct Singleton: -public rtl::StaticWithArg< -Instance, css::uno::Reference, Singleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -404,8 +388,7 @@ com_sun_star_comp_framework_UICategoryDescription_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -Singleton::get(context).instance.get())); +return cppu::acquire(new UICategoryDescription(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 80af7267b774..12ce9ec7d966 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -155,7 +155,8 @@ + constructor="com_sun_star_comp_framework_UICategoryDescription_get_implementation" + single-instance="true"> ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/uifactory/uicontrollerfactory.cxx | 21 + framework/util/fwk.component |3 ++- 2 files changed, 3 insertions(+), 21 deletions(-) New commits: commit ea004488f6d55eaebe58c595ac53392bf936b5e4 Author: Noel AuthorDate: Thu Mar 18 11:23:01 2021 +0200 Commit: Noel Grandin CommitDate: Sat Mar 20 07:52:33 2021 +0100 use single-use attribute for ToolbarControllerFactory instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: Ie856c5954965fc640dc34d500664be924ddab69c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112684 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/uifactory/uicontrollerfactory.cxx b/framework/source/uifactory/uicontrollerfactory.cxx index 5f81f80be026..493d1d5522d0 100644 --- a/framework/source/uifactory/uicontrollerfactory.cxx +++ b/framework/source/uifactory/uicontrollerfactory.cxx @@ -288,24 +288,6 @@ ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XComponentC { } -struct ToolbarControllerFactoryInstance { -explicit ToolbarControllerFactoryInstance( -css::uno::Reference const & context): -instance(static_cast( -new ToolbarControllerFactory(context))) -{ -} - -css::uno::Reference instance; -}; - -struct ToolbarControllerFactorySingleton: -public rtl::StaticWithArg< -ToolbarControllerFactoryInstance, -css::uno::Reference, -ToolbarControllerFactorySingleton> -{}; - class StatusbarControllerFactory : public UIControllerFactory { public: @@ -366,8 +348,7 @@ com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -ToolbarControllerFactorySingleton::get(context).instance.get())); +return cppu::acquire(new ToolbarControllerFactory(context)); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 2d71213468d6..80af7267b774 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -145,7 +145,8 @@ + constructor="com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation" + single-instance="true"> ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/uifactory/uicontrollerfactory.cxx | 21 + framework/util/fwk.component |3 ++- 2 files changed, 3 insertions(+), 21 deletions(-) New commits: commit 109312f4223a986444c589eca51eac7cdeb5ff48 Author: Noel AuthorDate: Thu Mar 18 11:24:37 2021 +0200 Commit: Noel Grandin CommitDate: Fri Mar 19 20:04:43 2021 +0100 use single-use attribute for PopupMenuControllerFactory instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: Ib7e51a5ba945ad151176d207d2d40f13d0fa6813 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112685 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/uifactory/uicontrollerfactory.cxx b/framework/source/uifactory/uicontrollerfactory.cxx index 619b66d7c420..5f81f80be026 100644 --- a/framework/source/uifactory/uicontrollerfactory.cxx +++ b/framework/source/uifactory/uicontrollerfactory.cxx @@ -261,24 +261,6 @@ PopupMenuControllerFactory::PopupMenuControllerFactory( const Reference< XCompon { } -struct PopupMenuControllerFactoryInstance { -explicit PopupMenuControllerFactoryInstance( -css::uno::Reference const & context): -instance(static_cast( -new PopupMenuControllerFactory(context))) -{ -} - -css::uno::Reference instance; -}; - -struct PopupMenuControllerFactorySingleton: -public rtl::StaticWithArg< -PopupMenuControllerFactoryInstance, -css::uno::Reference, -PopupMenuControllerFactorySingleton> -{}; - class ToolbarControllerFactory : public UIControllerFactory { public: @@ -376,8 +358,7 @@ com_sun_star_comp_framework_PopupMenuControllerFactory_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -PopupMenuControllerFactorySingleton::get(context).instance.get())); +return cppu::acquire(new PopupMenuControllerFactory(context)); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * diff --git a/framework/util/fwk.component b/framework/util/fwk.component index f3a0cfcf1edd..2d71213468d6 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -110,7 +110,8 @@ + constructor="com_sun_star_comp_framework_PopupMenuControllerFactory_get_implementation" + single-instance="true"> ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/uifactory/uielementfactorymanager.cxx | 19 - framework/util/fwk.component |3 +- 2 files changed, 3 insertions(+), 19 deletions(-) New commits: commit f5784794f4cecd4fd57a803191b544f80f7ba02e Author: Noel AuthorDate: Thu Mar 18 11:19:21 2021 +0200 Commit: Noel Grandin CommitDate: Fri Mar 19 17:37:07 2021 +0100 use single-use attribute for UIElementFactoryManager instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I52193861c4b2e07c3655773c8d185b2036336da2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112682 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx index 02d5435bab80..b1567724ff06 100644 --- a/framework/source/uifactory/uielementfactorymanager.cxx +++ b/framework/source/uifactory/uielementfactorymanager.cxx @@ -542,22 +542,6 @@ void SAL_CALL UIElementFactoryManager::deregisterFactory( const OUString& aType, // SAFE } -struct Instance { -explicit Instance( -css::uno::Reference const & context): -instance(static_cast( -new UIElementFactoryManager(context))) -{ -} - -css::uno::Reference instance; -}; - -struct Singleton: -public rtl::StaticWithArg< -Instance, css::uno::Reference, Singleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -565,8 +549,7 @@ com_sun_star_comp_framework_UIElementFactoryManager_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -Singleton::get(context).instance.get())); +return cppu::acquire(new UIElementFactoryManager(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index d6ca2652d3cf..9f050373c603 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -166,7 +166,8 @@ + constructor="com_sun_star_comp_framework_UIElementFactoryManager_get_implementation" + single-instance="true"> ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util
framework/source/uifactory/windowcontentfactorymanager.cxx | 19 - framework/util/fwk.component |3 +- 2 files changed, 3 insertions(+), 19 deletions(-) New commits: commit 22e4f7a348f82fae7eefae5b67de3d829dceadcb Author: Noel AuthorDate: Thu Mar 18 11:17:57 2021 +0200 Commit: Noel Grandin CommitDate: Fri Mar 19 17:36:29 2021 +0100 use single-use attribute for WindowContentFactoryManager instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I877c541c11d5c667b0d94cb3875f4263a9323dcb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112681 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/source/uifactory/windowcontentfactorymanager.cxx b/framework/source/uifactory/windowcontentfactorymanager.cxx index 996fae5f41a1..0d2991c80b7e 100644 --- a/framework/source/uifactory/windowcontentfactorymanager.cxx +++ b/framework/source/uifactory/windowcontentfactorymanager.cxx @@ -193,22 +193,6 @@ uno::Reference< uno::XInterface > SAL_CALL WindowContentFactoryManager::createIn return xWindow; } -struct Instance { -explicit Instance( -css::uno::Reference const & context): -instance(static_cast( -new WindowContentFactoryManager(context))) -{ -} - -css::uno::Reference instance; -}; - -struct Singleton: -public rtl::StaticWithArg< -Instance, css::uno::Reference, Singleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -216,8 +200,7 @@ com_sun_star_comp_framework_WindowContentFactoryManager_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { -return cppu::acquire(static_cast( -Singleton::get(context).instance.get())); +return cppu::acquire(new WindowContentFactoryManager(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index e056e8a9aeb6..d6ca2652d3cf 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -175,7 +175,8 @@ + constructor="com_sun_star_comp_framework_WindowContentFactoryManager_get_implementation" + single-instance="true"> ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/source framework/util officecfg/registry
framework/source/uielement/popuptoolbarcontroller.cxx | 58 ++ framework/util/fwk.component|4 officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu |5 3 files changed, 63 insertions(+), 4 deletions(-) New commits: commit 4f69d0810e76f17b2a24f74dc99c4b8a31ac63b7 Author: Maxim MonastirskyDate: Fri Nov 20 12:25:18 2015 +0200 Change the bits of the save button dynamically When the save slot is disabled, we want it to become a dropdown only instead of disabling it. Change-Id: I22fb04c8a0c9afc0a1af8f031a584cdaa99484f9 Reviewed-on: https://gerrit.libreoffice.org/20079 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 66c4ef4..4055cbc 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -302,6 +302,56 @@ ToolBoxItemBits GenericPopupToolbarController::getDropDownStyle() const return m_bSplitButton ? ToolBoxItemBits::DROPDOWN : ToolBoxItemBits::DROPDOWNONLY; } +class SaveToolbarController : public PopupMenuToolbarController +{ +public: +SaveToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + +// XStatusListener +virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override; + +// XServiceInfo +virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException ) override; +virtual sal_Bool SAL_CALL supportsService( OUString const & rServiceName ) throw ( css::uno::RuntimeException ) override; +virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw ( css::uno::RuntimeException ) override; +}; + +SaveToolbarController::SaveToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) +: PopupMenuToolbarController( rxContext, ".uno:SaveAsMenu" ) +{ +} + +void SaveToolbarController::statusChanged( const css::frame::FeatureStateEvent& rEvent ) +throw ( css::uno::RuntimeException, std::exception ) +{ +ToolBox* pToolBox = nullptr; +sal_uInt16 nId = 0; +if ( getToolboxId( nId, ) ) +{ +pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) & ~( rEvent.IsEnabled ? ToolBoxItemBits::DROPDOWNONLY : ToolBoxItemBits::DROPDOWN ) ); +pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ( rEvent.IsEnabled ? ToolBoxItemBits::DROPDOWN : ToolBoxItemBits::DROPDOWNONLY ) ); +} +} + +OUString SaveToolbarController::getImplementationName() +throw ( css::uno::RuntimeException ) +{ +return OUString("com.sun.star.comp.framework.SaveToolbarController"); +} + +sal_Bool SaveToolbarController::supportsService( OUString const & rServiceName ) +throw ( css::uno::RuntimeException ) +{ +return cppu::supportsService( this, rServiceName ); +} + +css::uno::Sequence< OUString > SaveToolbarController::getSupportedServiceNames() +throw ( css::uno::RuntimeException ) +{ +css::uno::Sequence aRet { "com.sun.star.frame.ToolbarController" }; +return aRet; +} + class NewToolbarController : public PopupMenuToolbarController { public: @@ -554,6 +604,14 @@ com_sun_star_comp_framework_GenericPopupToolbarController_get_implementation( } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_framework_SaveToolbarController_get_implementation( +css::uno::XComponentContext *context, +css::uno::Sequence const &) +{ +return cppu::acquire(new SaveToolbarController(context)); +} + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL org_apache_openoffice_comp_framework_NewToolbarController_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 4f5edfd..418f815 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -192,6 +192,10 @@ constructor="com_sun_star_comp_framework_GenericPopupToolbarController_get_implementation"> + + + diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index c603356..23b95fe 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -942,10 +942,7 @@ - com.sun.star.comp.framework.GenericPopupToolbarController - - - .uno:SaveAsMenu + com.sun.star.comp.framework.SaveToolbarController
[Libreoffice-commits] core.git: framework/source framework/util include/sfx2 officecfg/registry sc/source sd/source sfx2/source sw/source
framework/source/uielement/popuptoolbarcontroller.cxx | 107 +++--- framework/source/uielement/recentfilesmenucontroller.cxx|2 framework/util/fwk.component|8 include/sfx2/tbxctrl.hxx| 37 --- officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu | 53 sc/source/ui/app/scdll.cxx |3 sd/source/ui/app/sddll.cxx |2 sfx2/source/appl/appreg.cxx |3 sfx2/source/toolbox/tbxitem.cxx | 106 - sw/source/uibase/app/swmodule.cxx |2 10 files changed, 88 insertions(+), 235 deletions(-) New commits: commit 5da50768716fbcb0ffc093ecd588527723109fed Author: Maxim MonastirskyDate: Wed Nov 18 16:36:12 2015 +0200 Unify menu-based toolbar controllers The new GenericPopupToolbarController takes by default the popup menu controller that registered for the same .uno:Something command, and sets ToolBoxItemBits to ToolBoxItemBits::DROPDOWNONLY. If a different command specified using the "Value" property - takes the popup menu controller that registered for this command, and sets bits to ToolBoxItemBits::DROPDOWN. Change-Id: I75c5300bd27fcc9f618f2ee0df2aa6aefd088239 Reviewed-on: https://gerrit.libreoffice.org/20040 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index cdf07a1..66c4ef4 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -42,8 +43,6 @@ #include #include -#define UNO_COMMAND_RECENT_FILE_LIST".uno:RecentFileList" - using namespace framework; namespace { @@ -74,11 +73,11 @@ protected: void createPopupMenuController(); css::uno::Reference< css::uno::XComponentContext > m_xContext; -boolm_bHasController; +boolm_bHasController; +OUStringm_aPopupCommand; css::uno::Reference< css::awt::XPopupMenu > m_xPopupMenu; private: -OUString m_aPopupCommand; css::uno::Reference< css::frame::XUIControllerFactory > m_xPopupMenuFactory; css::uno::Reference< css::frame::XPopupMenuController > m_xPopupMenuController; }; @@ -217,16 +216,11 @@ void PopupMenuToolbarController::createPopupMenuController() if ( !m_xPopupMenuController.is() ) { -css::uno::Sequence< css::uno::Any > aArgs( 2 ); -css::beans::PropertyValue aProp; - -aProp.Name = "Frame"; -aProp.Value <<= m_xFrame; -aArgs[0] <<= aProp; +css::uno::Sequence< css::uno::Any > aArgs( 3 ); +aArgs[0] <<= comphelper::makePropertyValue( "Frame", m_xFrame ); +aArgs[1] <<= comphelper::makePropertyValue( "ModuleIdentifier", getModuleName() ); +aArgs[2] <<= comphelper::makePropertyValue( "InToolbar", true ); -aProp.Name = "ModuleIdentifier"; -aProp.Value <<= getModuleName(); -aArgs[1] <<= aProp; try { m_xPopupMenu.set( @@ -247,10 +241,11 @@ void PopupMenuToolbarController::createPopupMenuController() } } -class WizardsToolbarController : public PopupMenuToolbarController +class GenericPopupToolbarController : public PopupMenuToolbarController { public: -WizardsToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); +GenericPopupToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const css::uno::Sequence< css::uno::Any >& rxArgs ); // XServiceInfo virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException) override; @@ -260,75 +255,51 @@ public: virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException) override; private: +bool m_bSplitButton; ToolBoxItemBits getDropDownStyle() const override; }; -WizardsToolbarController::WizardsToolbarController( -const css::uno::Reference< css::uno::XComponentContext >& xContext ) +GenericPopupToolbarController::GenericPopupToolbarController( +const css::uno::Reference< css::uno::XComponentContext >& xContext, +const css::uno::Sequence< css::uno::Any >& rxArgs ) : PopupMenuToolbarController( xContext ) +, m_bSplitButton( false ) { +css::beans::PropertyValue aPropValue; +for ( const auto& arg: