[Libreoffice-commits] core.git: formula/source include/unotools sc/source starmath/source svl/qa unotools/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Fri Sep 17 06:41:33 UTC 2021
formula/source/ui/dlg/FormulaHelper.cxx | 2 +-
formula/source/ui/dlg/funcpage.cxx | 6 +++---
include/unotools/syslocale.hxx | 1 -
sc/source/core/data/global.cxx | 2 +-
starmath/source/parse5.cxx | 2 +-
svl/qa/unit/svl.cxx | 6 +++---
unotools/source/misc/syslocale.cxx | 13 ++++---------
7 files changed, 13 insertions(+), 19 deletions(-)
New commits:
commit 7fd3c5e8e5897617f1e89fda26f8cdbd4092071d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Sep 16 15:55:30 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Sep 17 08:40:59 2021 +0200
remove GetCharClassPtr from SvtSysLocale
we already have GetCharClass and we never return a nullptr
Change-Id: I3cb79bc60be614c0474ecfdaad17991f2ecb6368
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122208
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx
index 709a927e5040..15d3b411a4a2 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -69,7 +69,7 @@ FormulaHelper::FormulaHelper(const IFunctionManager* _pFunctionManager)
,arrayOpen(_pFunctionManager->getSingleToken(IFunctionManager::eArrayOpen))
,arrayClose(_pFunctionManager->getSingleToken(IFunctionManager::eArrayClose))
{
- m_pCharClass = m_pSysLocale->GetCharClassPtr();
+ m_pCharClass = &m_pSysLocale->GetCharClass();
}
sal_Int32 FormulaHelper::GetCategoryCount() const
diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx
index 338f37bd2dd7..f591c73a21e6 100644
--- a/formula/source/ui/dlg/funcpage.cxx
+++ b/formula/source/ui/dlg/funcpage.cxx
@@ -132,8 +132,8 @@ void FuncPage::UpdateFunctionList(const OUString& aStr)
else
{
SvtSysLocale aSysLocale;
- const CharClass* pCharClass = aSysLocale.GetCharClassPtr();
- const OUString aSearchStr(pCharClass->uppercase(aStr));
+ const CharClass& rCharClass = aSysLocale.GetCharClass();
+ const OUString aSearchStr(rCharClass.uppercase(aStr));
const sal_uInt32 nCategoryCount = m_pFunctionManager->getCount();
// Category listbox holds additional entries for Last Used and All, so
@@ -159,7 +159,7 @@ void FuncPage::UpdateFunctionList(const OUString& aStr)
for (sal_uInt32 j = 0; j < nFunctionCount; ++j)
{
TFunctionDesc pDesc(pCategory->getFunction(j));
- if (pCharClass->uppercase(pDesc->getFunctionName()).indexOf(aSearchStr) >= 0)
+ if (rCharClass.uppercase(pDesc->getFunctionName()).indexOf(aSearchStr) >= 0)
{
if (!pDesc->isHidden())
{
diff --git a/include/unotools/syslocale.hxx b/include/unotools/syslocale.hxx
index 5bb2d5222720..ae3153b7976a 100644
--- a/include/unotools/syslocale.hxx
+++ b/include/unotools/syslocale.hxx
@@ -61,7 +61,6 @@ public:
INSTANCE OF SvtSysLocale LIVES!
It is a faster access but be sure what you do!
*/
- const CharClass* GetCharClassPtr() const;
SvtSysLocaleOptions& GetOptions() const;
const LanguageTag& GetLanguageTag() const;
const LanguageTag& GetUILanguageTag() const;
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index f1e1ccf6e3f3..4f55f36a2c7a 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -1015,7 +1015,7 @@ const CharClass* ScGlobal::getCharClassPtr()
xSysLocale,
"ScGlobal::getCharClassPtr() called before ScGlobal::Init()");
- return xSysLocale->GetCharClassPtr();
+ return &xSysLocale->GetCharClass();
}
CalendarWrapper* ScGlobal::GetCalendar()
diff --git a/starmath/source/parse5.cxx b/starmath/source/parse5.cxx
index a3b253bfd308..d629fd36ddb1 100644
--- a/starmath/source/parse5.cxx
+++ b/starmath/source/parse5.cxx
@@ -2695,7 +2695,7 @@ SmParser5::SmParser5()
, m_bExportSymNames(false)
, m_nParseDepth(0)
, m_aNumCC(LanguageTag(LANGUAGE_ENGLISH_US))
- , m_pSysCC(SM_MOD()->GetSysLocale().GetCharClassPtr())
+ , m_pSysCC(&SM_MOD()->GetSysLocale().GetCharClass())
{
}
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index c9bcbc8806b7..8baffff86cab 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -327,7 +327,7 @@ void Test::testSharedString()
void Test::testSharedStringPool()
{
SvtSysLocale aSysLocale;
- svl::SharedStringPool aPool(*aSysLocale.GetCharClassPtr());
+ svl::SharedStringPool aPool(aSysLocale.GetCharClass());
svl::SharedString p1, p2;
p1 = aPool.intern("Andy");
@@ -360,7 +360,7 @@ void Test::testSharedStringPool()
void Test::testSharedStringPoolPurge()
{
SvtSysLocale aSysLocale;
- svl::SharedStringPool aPool(*aSysLocale.GetCharClassPtr());
+ svl::SharedStringPool aPool(aSysLocale.GetCharClass());
aPool.intern("Andy");
aPool.intern("andy");
aPool.intern("ANDY");
@@ -418,7 +418,7 @@ void Test::testSharedStringPoolPurgeBug1()
// We had a bug where, if we had two strings that mapped to the same uppercase string,
// purge() would de-reference a dangling pointer and consequently cause an ASAN failure.
SvtSysLocale aSysLocale;
- svl::SharedStringPool aPool(*aSysLocale.GetCharClassPtr());
+ svl::SharedStringPool aPool(aSysLocale.GetCharClass());
aPool.intern("Andy");
aPool.intern("andy");
aPool.purge();
diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx
index 0201d9f8be72..2882eb7fc436 100644
--- a/unotools/source/misc/syslocale.cxx
+++ b/unotools/source/misc/syslocale.cxx
@@ -53,7 +53,7 @@ public:
SvtSysLocale_Impl();
virtual ~SvtSysLocale_Impl() override;
- CharClass* GetCharClass();
+ CharClass& GetCharClass();
virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints ) override;
private:
@@ -75,11 +75,11 @@ SvtSysLocale_Impl::~SvtSysLocale_Impl()
aSysLocaleOptions.RemoveListener( this );
}
-CharClass* SvtSysLocale_Impl::GetCharClass()
+CharClass& SvtSysLocale_Impl::GetCharClass()
{
if ( !pCharClass )
pCharClass.reset(new CharClass( aSysLocaleOptions.GetRealLanguageTag() ));
- return pCharClass.get();
+ return *pCharClass;
}
void SvtSysLocale_Impl::ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints nHint )
@@ -93,7 +93,7 @@ void SvtSysLocale_Impl::ConfigurationChanged( utl::ConfigurationBroadcaster*, Co
const LanguageTag& rLanguageTag = aSysLocaleOptions.GetRealLanguageTag();
if ( nHint & ConfigurationHints::Locale )
{
- GetCharClass()->setLanguageTag( rLanguageTag );
+ GetCharClass().setLanguageTag( rLanguageTag );
}
pLocaleData.reset(new LocaleDataWrapper(rLanguageTag, getDateAcceptancePatternsConfig()));
}
@@ -147,11 +147,6 @@ const LocaleDataWrapper& SvtSysLocale::GetLocaleData() const
}
const CharClass& SvtSysLocale::GetCharClass() const
-{
- return *(pImpl->GetCharClass());
-}
-
-const CharClass* SvtSysLocale::GetCharClassPtr() const
{
return pImpl->GetCharClass();
}
More information about the Libreoffice-commits
mailing list