include/svl/numformat.hxx | 3 --- svl/source/numbers/zforlist.cxx | 38 ++++++++++++++++---------------------- 2 files changed, 16 insertions(+), 25 deletions(-)
New commits: commit 657631791421eae2c88a89da27bd2c0dc1822175 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Feb 29 12:33:23 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Feb 29 15:13:20 2024 +0100 SvNumberFormatter::ImpConstruct is only used once by the single ctor so fold it into the ctor Change-Id: If063143ef47a8ab293edf3896fb51079d0e0284f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164144 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/include/svl/numformat.hxx b/include/svl/numformat.hxx index 0a374f3c3301..8d244c360663 100644 --- a/include/svl/numformat.hxx +++ b/include/svl/numformat.hxx @@ -609,9 +609,6 @@ private: // get the registry, create one if none exists SVL_DLLPRIVATE static SvNumberFormatterRegistry_Impl& GetFormatterRegistry(); - // called by ctors - SVL_DLLPRIVATE void ImpConstruct(LanguageType eLang); - // Generate builtin formats provided by i18n behind CLOffset, // if bNoAdditionalFormats==false also generate additional i18n formats. SVL_DLLPRIVATE void ImpGenerateFormats(sal_uInt32 CLOffset, bool bNoAdditionalFormats); diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 79265d7ebb09..8833d45cd1cf 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -276,28 +276,6 @@ SvNumberFormatter::SvNumberFormatter( const Reference< XComponentContext >& rxCo LanguageType eLang ) : m_xContext( rxContext ) , maLanguageTag( eLang) -{ - ImpConstruct( eLang ); -} - -SvNumberFormatter::~SvNumberFormatter() -{ - { - ::osl::MutexGuard aGuard( GetGlobalMutex() ); - pFormatterRegistry->Remove( this ); - if ( !pFormatterRegistry->Count() ) - { - delete pFormatterRegistry; - pFormatterRegistry = nullptr; - } - } - - aFTable.clear(); - ClearMergeTable(); -} - - -void SvNumberFormatter::ImpConstruct( LanguageType eLang ) { if ( eLang == LANGUAGE_DONTKNOW ) { @@ -334,6 +312,22 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang ) GetFormatterRegistry().Insert( this ); } +SvNumberFormatter::~SvNumberFormatter() +{ + { + ::osl::MutexGuard aGuard( GetGlobalMutex() ); + pFormatterRegistry->Remove( this ); + if ( !pFormatterRegistry->Count() ) + { + delete pFormatterRegistry; + pFormatterRegistry = nullptr; + } + } + + aFTable.clear(); + ClearMergeTable(); +} + void SvNumberFormatter::ChangeIntl(LanguageType eLnge) {