diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-02-16 18:37:04 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-02-22 19:56:17 +0100 |
commit | 3ac9f491c20fb56c4544444d876687dd6d8de231 (patch) | |
tree | 93d979296e5493aa2f4fd875fa9556eff700796b /sc/source/ui/namedlg | |
parent | 6fbfad6b00e8c35346ee59cd32a0d7ccc0d8c19c (diff) |
ScGlobal - change direct access to a static ptr for a getter
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 <quikee@gmail.com>
Diffstat (limited to 'sc/source/ui/namedlg')
-rw-r--r-- | sc/source/ui/namedlg/namedefdlg.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/namedlg/namedlg.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/namedlg/namemgrtable.cxx | 2 |
3 files changed, 6 insertions, 6 deletions
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() |