formula/source/ui/dlg/FormulaHelper.cxx |    5 ++---
 include/formula/formulahelper.hxx       |    2 +-
 starmath/inc/smmod.hxx                  |    3 ++-
 starmath/source/smmod.cxx               |    6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit bee4402c7ed97f3373f93eb7939940557bd59912
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Feb 26 20:17:36 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Feb 26 19:50:19 2023 +0000

    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 <noel.gran...@collabora.co.uk>

diff --git a/formula/source/ui/dlg/FormulaHelper.cxx 
b/formula/source/ui/dlg/FormulaHelper.cxx
index 85799c40ecc2..58d474de8015 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -61,15 +61,14 @@ namespace formula
 #define FUNC_NOTFOUND -1
 
 FormulaHelper::FormulaHelper(const IFunctionManager* _pFunctionManager)
-    :m_pSysLocale(new SvtSysLocale)
-    ,m_pFunctionManager(_pFunctionManager)
+    :m_pFunctionManager(_pFunctionManager)
     ,open(_pFunctionManager->getSingleToken(IFunctionManager::eOk))
     ,close(_pFunctionManager->getSingleToken(IFunctionManager::eClose))
     ,sep(_pFunctionManager->getSingleToken(IFunctionManager::eSep))
     ,arrayOpen(_pFunctionManager->getSingleToken(IFunctionManager::eArrayOpen))
     
,arrayClose(_pFunctionManager->getSingleToken(IFunctionManager::eArrayClose))
 {
-    m_pCharClass = &m_pSysLocale->GetCharClass();
+    m_pCharClass = &m_aSysLocale.GetCharClass();
 }
 
 sal_Int32 FormulaHelper::GetCategoryCount() const
diff --git a/include/formula/formulahelper.hxx 
b/include/formula/formulahelper.hxx
index f57a276fb178..e6173eb65e53 100644
--- a/include/formula/formulahelper.hxx
+++ b/include/formula/formulahelper.hxx
@@ -37,7 +37,7 @@ namespace formula
 
     class FORMULA_DLLPUBLIC FormulaHelper
     {
-        ::std::unique_ptr<SvtSysLocale> m_pSysLocale;
+        SvtSysLocale                    m_aSysLocale;
         const CharClass*                m_pCharClass;
         const IFunctionManager*         m_pFunctionManager;
         const sal_Unicode open;
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 <sfx2/app.hxx>
 #include <vcl/vclptr.hxx>
 #include <unotools/options.hxx>
+#include <optional>
 
 namespace svtools { class ColorConfig; }
 
@@ -65,7 +66,7 @@ class SmModule final : public SfxModule, public 
utl::ConfigurationListener
     std::unique_ptr<svtools::ColorConfig> mpColorConfig;
     std::unique_ptr<SmMathConfig> mpConfig;
     std::unique_ptr<SmLocalizedSymbolData> mpLocSymbolData;
-    std::unique_ptr<SvtSysLocale> mpSysLocale;
+    std::optional<SvtSysLocale> moSysLocale;
     VclPtr<VirtualDevice>    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()

Reply via email to