diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-03-05 11:23:38 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-03-07 15:37:22 +0100 |
commit | 4256c764aee0777770466115a97420d9b55c23ac (patch) | |
tree | 9452b0dc5c84355826d070ad3eccba498ef9c5e8 /sd | |
parent | 58c6a36bfcc853ca9da81fbc2d071fa50585655b (diff) |
do not pass XComponentContext to officecfg::...::get() calls
It's used only for the ConfigurationWrapper singleton, so it's used
only the first time and then ignored. It also causes calls to
comphelper::getProcessComponentContext() for every single invocation
despite the value not being needed, and the calls may not be cheap
(it's ~5% CPU during ODS save because relatively frequent calls
to officecfg::Office::Common::Save::ODF::DefaultVersion::get()).
Change-Id: I02c17a1a9cb498aeef220ddd5a0bde5523cb0ffb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131056
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/drawdoc.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/remotecontrol/Server.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 7 |
3 files changed, 5 insertions, 9 deletions
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index d765e3639288..f1a9a55cedcd 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -1111,7 +1111,7 @@ void SdDrawDocument::InitLayoutVector() // get file list from configuration const Sequence< OUString > aFiles( - officecfg::Office::Impress::Misc::LayoutListFiles::get(xContext) ); + officecfg::Office::Impress::Misc::LayoutListFiles::get() ); OUString sFilename; for( const auto& rFile : aFiles ) @@ -1150,7 +1150,7 @@ void SdDrawDocument::InitObjectVector() // get file list from configuration const Sequence< OUString > aFiles( - officecfg::Office::Impress::Misc::PresObjListFiles::get(xContext) ); + officecfg::Office::Impress::Misc::PresObjListFiles::get() ); OUString sFilename; for( const auto& rFile : aFiles ) diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx index d1942df124c8..ab583c471982 100644 --- a/sd/source/ui/remotecontrol/Server.cxx +++ b/sd/source/ui/remotecontrol/Server.cxx @@ -348,8 +348,7 @@ void SdDLL::RegisterRemotes() if ( Application::IsHeadlessModeEnabled() ) return; - uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); - if ( xContext.is() && !officecfg::Office::Impress::Misc::Start::EnableSdremote::get( xContext ) ) + if ( !officecfg::Office::Impress::Misc::Start::EnableSdremote::get() ) return; sd::RemoteServer::setup(); diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index cf0eb92c3828..4f375dc6a05c 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1007,11 +1007,8 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) #ifndef ENABLE_SDREMOTE bDisableSdremoteForGood = true; #endif - uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); - if ( xContext.is() ) - bDisableSdremoteForGood |= ! ( /*officecfg::Office::Common::Misc::ExperimentalMode::get( xContext ) &&*/ - - officecfg::Office::Impress::Misc::Start::EnableSdremote::get( xContext ) ); + bDisableSdremoteForGood |= ! ( /*officecfg::Office::Common::Misc::ExperimentalMode::get() &&*/ + officecfg::Office::Impress::Misc::Start::EnableSdremote::get() ); // This dialog is only useful for TCP/IP remote control // which is unusual, under-tested and a security issue. |