From bee4402c7ed97f3373f93eb7939940557bd59912 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 26 Feb 2023 20:17:36 +0200 Subject: no need to hold SvtSysLocale by std::unique_ptr allocate it inline, it is only one pointer in size Change-Id: I736f3322784897054993fbddd423f36357f817c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147741 Tested-by: Jenkins Reviewed-by: Noel Grandin --- starmath/inc/smmod.hxx | 3 ++- starmath/source/smmod.cxx | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'starmath') diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx index f75643d0ffe8..9ab99c2420d7 100644 --- a/starmath/inc/smmod.hxx +++ b/starmath/inc/smmod.hxx @@ -23,6 +23,7 @@ #include #include #include +#include namespace svtools { class ColorConfig; } @@ -65,7 +66,7 @@ class SmModule final : public SfxModule, public utl::ConfigurationListener std::unique_ptr mpColorConfig; std::unique_ptr mpConfig; std::unique_ptr mpLocSymbolData; - std::unique_ptr mpSysLocale; + std::optional moSysLocale; VclPtr mpVirtualDev; public: diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx index 783965844b38..934e6090eaf1 100644 --- a/starmath/source/smmod.cxx +++ b/starmath/source/smmod.cxx @@ -173,9 +173,9 @@ SmSymbolManager & SmModule::GetSymbolManager() const SvtSysLocale& SmModule::GetSysLocale() { - if( !mpSysLocale ) - mpSysLocale.reset(new SvtSysLocale); - return *mpSysLocale; + if( !moSysLocale ) + moSysLocale.emplace(); + return *moSysLocale; } VirtualDevice &SmModule::GetDefaultVirtualDev() -- cgit