From 3ac9f491c20fb56c4544444d876687dd6d8de231 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sun, 16 Feb 2020 18:37:04 +0100 Subject: ScGlobal - change direct access to a static ptr for a getter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pLocalData and pCharClass static veriables on ScGlobal are always set from SvtSysLocale on init, probably for "faster" access. This can just be made simpler with access through a getter, so this introduces a getter for ScGlobal::getCharClassPtr and ScGlobal::getLocaleDataPtr, where the access is made directly to SvtSysLocale instance. In addition all the usages needed to be fixed, which is all over the calc module. Change-Id: Ie047b158094e25bbaa2aba15074d7998d9541787 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89249 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- sc/source/ui/namedlg/namedefdlg.cxx | 2 +- sc/source/ui/namedlg/namedlg.cxx | 8 ++++---- sc/source/ui/namedlg/namemgrtable.cxx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sc/source/ui/namedlg') diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx index 8f5c45f85d8d..012b785b88a2 100644 --- a/sc/source/ui/namedlg/namedefdlg.cxx +++ b/sc/source/ui/namedlg/namedefdlg.cxx @@ -153,7 +153,7 @@ bool ScNameDefDlg::IsNameValid() m_xBtnAdd->set_sensitive(false); return false; } - else if (pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(aName))) + else if (pRangeName->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName))) { m_xFtInfo->set_message_type(weld::EntryMessageType::Error); m_xFtInfo->set_label(maErrNameInUse); diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx index 8a8f2f76ea05..7c3a91e320af 100644 --- a/sc/source/ui/namedlg/namedlg.cxx +++ b/sc/source/ui/namedlg/namedlg.cxx @@ -256,7 +256,7 @@ bool ScNameDlg::IsNameValid() m_xFtInfo->set_label(maErrInvalidNameStr); return false; } - else if (pRangeName && pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(aName))) + else if (pRangeName && pRangeName->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName))) { m_xFtInfo->set_message_type(weld::EntryMessageType::Error); m_xFtInfo->set_label(maErrNameInUse); @@ -292,7 +292,7 @@ ScRangeName* ScNameDlg::GetRangeName(const OUString& rScope) void ScNameDlg::ShowOptions(const ScRangeNameLine& rLine) { ScRangeName* pRangeName = GetRangeName(rLine.aScope); - ScRangeData* pData = pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(rLine.aName)); + ScRangeData* pData = pRangeName->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rLine.aName)); if (pData) { UpdateChecks(pData); @@ -325,7 +325,7 @@ void ScNameDlg::RemovePushed() for (const auto& rEntry : aEntries) { ScRangeName* pRangeName = GetRangeName(rEntry.aScope); - ScRangeData* pData = pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(rEntry.aName)); + ScRangeData* pData = pRangeName->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rEntry.aName)); OSL_ENSURE(pData, "table and model should be in sync"); // be safe and check for possible problems if (pData) @@ -368,7 +368,7 @@ void ScNameDlg::NameModified() OUString aNewScope = m_xLbScope->get_active_text(); ScRangeName* pOldRangeName = GetRangeName( aOldScope ); - ScRangeData* pData = pOldRangeName->findByUpperName( ScGlobal::pCharClass->uppercase(aOldName) ); + ScRangeData* pData = pOldRangeName->findByUpperName( ScGlobal::getCharClassPtr()->uppercase(aOldName) ); ScRangeName* pNewRangeName = GetRangeName( aNewScope ); OSL_ENSURE(pData, "model and table should be in sync"); // be safe and check for range data diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx index 45d2cb49ac13..3c2b41a4d4c5 100644 --- a/sc/source/ui/namedlg/namemgrtable.cxx +++ b/sc/source/ui/namedlg/namemgrtable.cxx @@ -87,7 +87,7 @@ const ScRangeData* ScRangeManagerTable::findRangeData(const ScRangeNameLine& rLi else pRangeName = m_RangeMap.find(rLine.aScope)->second.get(); - return pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(rLine.aName)); + return pRangeName->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rLine.aName)); } void ScRangeManagerTable::CheckForFormulaString() -- cgit