summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-30 15:27:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-30 19:17:23 +0200
commit353dbd9afe8a373d8b2c7e3982b5110d224b2d9f (patch)
treeeeba5c6b5130fd69de96866c15aaf701503fbddf /unotools
parent2e32150731f0ec5176731686d77e2873023e9dd4 (diff)
no need to allocate LocaleDataWrapper separately
Change-Id: Icceaf255a3a71d612b17dad41d04b1906550a7a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135133 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/misc/syslocale.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx
index 954e7e94caf8..a1325958a0d4 100644
--- a/unotools/source/misc/syslocale.cxx
+++ b/unotools/source/misc/syslocale.cxx
@@ -60,7 +60,7 @@ class SvtSysLocale_Impl : public utl::ConfigurationListener
{
public:
SvtSysLocaleOptions aSysLocaleOptions;
- std::unique_ptr<LocaleDataWrapper> pLocaleData;
+ std::optional<LocaleDataWrapper> moLocaleData;
std::optional<CharClass> moCharClass;
SvtSysLocale_Impl();
@@ -75,9 +75,9 @@ private:
SvtSysLocale_Impl::SvtSysLocale_Impl()
{
- pLocaleData.reset(new LocaleDataWrapper(
+ moLocaleData.emplace(
aSysLocaleOptions.GetRealLanguageTag(),
- getDateAcceptancePatternsConfig() ));
+ getDateAcceptancePatternsConfig() );
// listen for further changes
aSysLocaleOptions.AddListener( this );
@@ -108,7 +108,7 @@ void SvtSysLocale_Impl::ConfigurationChanged( utl::ConfigurationBroadcaster*, Co
{
moCharClass.emplace( rLanguageTag );
}
- pLocaleData.reset(new LocaleDataWrapper(rLanguageTag, getDateAcceptancePatternsConfig()));
+ moLocaleData.emplace(rLanguageTag, getDateAcceptancePatternsConfig());
}
std::vector<OUString> SvtSysLocale_Impl::getDateAcceptancePatternsConfig() const
@@ -145,7 +145,7 @@ SvtSysLocale::~SvtSysLocale()
const LocaleDataWrapper& SvtSysLocale::GetLocaleData() const
{
- return *(pImpl->pLocaleData);
+ return *(pImpl->moLocaleData);
}
const CharClass& SvtSysLocale::GetCharClass() const