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 /svl | |
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 'svl')
-rw-r--r-- | svl/source/config/asiancfg.cxx | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/svl/source/config/asiancfg.cxx b/svl/source/config/asiancfg.cxx index 5f179447839d..3ff5797fccaf 100644 --- a/svl/source/config/asiancfg.cxx +++ b/svl/source/config/asiancfg.cxx @@ -54,15 +54,12 @@ OUString toString(css::lang::Locale const & locale) { struct SvxAsianConfig::Impl { Impl(): - context(comphelper::getProcessComponentContext()), - batch(comphelper::ConfigurationChanges::create(context)) + batch(comphelper::ConfigurationChanges::create()) {} Impl(const Impl&) = delete; Impl& operator=(const Impl&) = delete; - css::uno::Reference< css::uno::XComponentContext > context; - std::shared_ptr< comphelper::ConfigurationChanges > batch; }; @@ -76,8 +73,7 @@ void SvxAsianConfig::Commit() { bool SvxAsianConfig::IsKerningWesternTextOnly() const { return - officecfg::Office::Common::AsianLayout::IsKerningWesternTextOnly::get( - impl_->context); + officecfg::Office::Common::AsianLayout::IsKerningWesternTextOnly::get(); } void SvxAsianConfig::SetKerningWesternTextOnly(bool value) { @@ -86,8 +82,7 @@ void SvxAsianConfig::SetKerningWesternTextOnly(bool value) { } CharCompressType SvxAsianConfig::GetCharDistanceCompression() const { - return static_cast<CharCompressType>(officecfg::Office::Common::AsianLayout::CompressCharacterDistance::get( - impl_->context)); + return static_cast<CharCompressType>(officecfg::Office::Common::AsianLayout::CompressCharacterDistance::get()); } void SvxAsianConfig::SetCharDistanceCompression(CharCompressType value) { @@ -99,8 +94,7 @@ css::uno::Sequence< css::lang::Locale > SvxAsianConfig::GetStartEndCharLocales() const { const css::uno::Sequence< OUString > ns( - officecfg::Office::Common::AsianLayout::StartEndCharacters::get( - impl_->context)-> + officecfg::Office::Common::AsianLayout::StartEndCharacters::get()-> getElementNames()); css::uno::Sequence< css::lang::Locale > ls(ns.getLength()); std::transform(ns.begin(), ns.end(), ls.getArray(), @@ -114,8 +108,7 @@ bool SvxAsianConfig::GetStartEndChars( OUString & endChars) const { css::uno::Reference< css::container::XNameAccess > set( - officecfg::Office::Common::AsianLayout::StartEndCharacters::get( - impl_->context)); + officecfg::Office::Common::AsianLayout::StartEndCharacters::get()); css::uno::Any v; try { v = set->getByName(toString(locale)); |