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 | |
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>
78 files changed, 218 insertions, 218 deletions
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 0fef008448d5..ca8591990e4d 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -537,11 +537,8 @@ class ScGlobal public: static SvtSysLocale* pSysLocale; - // for faster access a pointer to the single instance provided by SvtSysLocale - SC_DLLPUBLIC static const CharClass* pCharClass; - // for faster access a pointer to the single instance provided by SvtSysLocale - SC_DLLPUBLIC static const LocaleDataWrapper* pLocaleData; - SC_DLLPUBLIC static const LocaleDataWrapper* GetpLocaleData(); + SC_DLLPUBLIC static const LocaleDataWrapper* getLocaleDataPtr(); + SC_DLLPUBLIC static const CharClass* getCharClassPtr(); static CalendarWrapper* GetCalendar(); SC_DLLPUBLIC static CollatorWrapper* GetCollator(); diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 36b4d2d0556a..cc45c83c30d4 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -92,7 +92,7 @@ using namespace com::sun::star; const sal_uInt16 ScDocument::nSrcVer = SC_CURRENT_VERSION; ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : - mpCellStringPool(std::make_shared<svl::SharedStringPool>(*ScGlobal::pCharClass)), + mpCellStringPool(std::make_shared<svl::SharedStringPool>(*ScGlobal::getCharClassPtr())), mpDocLinkMgr(new sc::DocumentLinkManager(pDocShell)), mbFormulaGroupCxtBlockDiscard(false), maCalcConfig( ScInterpreter::GetGlobalConfig()), @@ -1326,9 +1326,9 @@ void ScDocument::GetCellChangeTrackNote( const ScAddress &aCellPos, OUString &aT DateTime aDT = pFound->GetDateTime(); aTrackText = pFound->GetUser(); aTrackText += ", "; - aTrackText += ScGlobal::pLocaleData->getDate(aDT); + aTrackText += ScGlobal::getLocaleDataPtr()->getDate(aDT); aTrackText += " "; - aTrackText += ScGlobal::pLocaleData->getTime(aDT); + aTrackText += ScGlobal::getLocaleDataPtr()->getTime(aDT); aTrackText += ":\n"; OUString aComStr = pFound->GetComment(); if(!aComStr.isEmpty()) diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 44a303c71921..6ff14d683189 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -266,7 +266,7 @@ bool ScDocument::GetTable( const OUString& rName, SCTAB& rTab ) const { aCacheName = rName; // surprisingly slow ... - aCacheUpperName = ScGlobal::pCharClass->uppercase(rName); + aCacheUpperName = ScGlobal::getCharClassPtr()->uppercase(rName); } aUpperName = aCacheUpperName; @@ -375,7 +375,7 @@ bool ScDocument::ValidNewTabName( const OUString& rName ) const bool bValid = ValidTabName(rName); if (!bValid) return false; - OUString aUpperName = ScGlobal::pCharClass->uppercase(rName); + OUString aUpperName = ScGlobal::getCharClassPtr()->uppercase(rName); for (const auto& a : maTabs) { if (!a) diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index 60b8a2f87d24..32a8a83b2b73 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -337,7 +337,7 @@ typedef std::unordered_set<OUString> LabelSet; void normalizeAddLabel(const OUString& rLabel, std::vector<OUString>& rLabels, LabelSet& rExistingNames) { - const OUString aLabelLower = ScGlobal::pCharClass->lowercase(rLabel); + const OUString aLabelLower = ScGlobal::getCharClassPtr()->lowercase(rLabel); sal_Int32 nSuffix = 1; OUString aNewLabel = rLabel; OUString aNewLabelLower = aLabelLower; @@ -1255,7 +1255,7 @@ OUString ScDPCache::GetFormattedString(long nDim, const ScDPItemData& rItem, boo if (!p) return rItem.GetString(); - sal_Unicode cDecSep = ScGlobal::pLocaleData->getNumDecimalSep()[0]; + sal_Unicode cDecSep = ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0]; return ScDPUtil::getNumGroupName(fVal, p->maInfo, cDecSep, mpDoc->GetFormatTable()); } diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index b85365146816..785f7e4eee1f 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -1316,17 +1316,17 @@ public: { // Layout name takes precedence. const std::optional<OUString> & pLayoutName = pDim->GetLayoutName(); - if (pLayoutName && ScGlobal::pCharClass->uppercase(*pLayoutName) == maName) + if (pLayoutName && ScGlobal::getCharClassPtr()->uppercase(*pLayoutName) == maName) return true; ScGeneralFunction eGenFunc = pDim->GetFunction(); ScSubTotalFunc eFunc = ScDPUtil::toSubTotalFunc(eGenFunc); OUString aSrcName = ScDPUtil::getSourceDimensionName(pDim->GetName()); OUString aFuncName = ScDPUtil::getDisplayedMeasureName(aSrcName, eFunc); - if (maName == ScGlobal::pCharClass->uppercase(aFuncName)) + if (maName == ScGlobal::getCharClassPtr()->uppercase(aFuncName)) return true; - return maName == ScGlobal::pCharClass->uppercase(aSrcName); + return maName == ScGlobal::getCharClassPtr()->uppercase(aSrcName); } }; @@ -1371,7 +1371,7 @@ double ScDPObject::GetPivotData(const OUString& rDataFieldName, std::vector<shee std::vector<const ScDPSaveDimension*>::iterator it = std::find_if( aDataDims.begin(), aDataDims.end(), - FindByName(ScGlobal::pCharClass->uppercase(rDataFieldName))); + FindByName(ScGlobal::getCharClassPtr()->uppercase(rDataFieldName))); if (it == aDataDims.end()) return fRet; diff --git a/sc/source/core/data/dpresfilter.cxx b/sc/source/core/data/dpresfilter.cxx index 6a1cef68b5a9..c0a496cb76ce 100644 --- a/sc/source/core/data/dpresfilter.cxx +++ b/sc/source/core/data/dpresfilter.cxx @@ -104,7 +104,7 @@ void ScDPResultTree::add( // See if this dimension exists. auto& rDims = pMemNode->maChildDimensions; - OUString aUpperName = ScGlobal::pCharClass->uppercase(filter.maDimName); + OUString aUpperName = ScGlobal::getCharClassPtr()->uppercase(filter.maDimName); auto itDim = rDims.find(aUpperName); if (itDim == rDims.end()) { @@ -119,7 +119,7 @@ void ScDPResultTree::add( // Now, see if this dimension member exists. DimensionNode* pDim = itDim->second.get(); MembersType& rMembersValueNames = pDim->maChildMembersValueNames; - aUpperName = ScGlobal::pCharClass->uppercase(filter.maValueName); + aUpperName = ScGlobal::getCharClassPtr()->uppercase(filter.maValueName); MembersType::iterator itMem = rMembersValueNames.find(aUpperName); if (itMem == rMembersValueNames.end()) { @@ -139,7 +139,7 @@ void ScDPResultTree::add( if (!filter.maValue.isEmpty() && filter.maValue != filter.maValueName) { MembersType& rMembersValues = pDim->maChildMembersValues; - aUpperName = ScGlobal::pCharClass->uppercase(filter.maValue); + aUpperName = ScGlobal::getCharClassPtr()->uppercase(filter.maValue); MembersType::iterator itMemVal = rMembersValues.find(aUpperName); if (itMemVal == rMembersValues.end()) { @@ -159,8 +159,8 @@ void ScDPResultTree::add( if (pDimName && pMemName) { NamePairType aNames( - ScGlobal::pCharClass->uppercase(*pDimName), - ScGlobal::pCharClass->uppercase(*pMemName)); + ScGlobal::getCharClassPtr()->uppercase(*pDimName), + ScGlobal::getCharClassPtr()->uppercase(*pMemName)); LeafValuesType::iterator it = maLeafValues.find(aNames); if (it == maLeafValues.end()) @@ -203,7 +203,7 @@ const ScDPResultTree::ValuesType* ScDPResultTree::getResults( for (const sheet::DataPilotFieldFilter& rFilter : rFilters) { auto itDim = pMember->maChildDimensions.find( - ScGlobal::pCharClass->uppercase(rFilter.FieldName)); + ScGlobal::getCharClassPtr()->uppercase(rFilter.FieldName)); if (itDim == pMember->maChildDimensions.end()) // Specified dimension not found. @@ -211,12 +211,12 @@ const ScDPResultTree::ValuesType* ScDPResultTree::getResults( const DimensionNode* pDim = itDim->second.get(); MembersType::const_iterator itMem( pDim->maChildMembersValueNames.find( - ScGlobal::pCharClass->uppercase( rFilter.MatchValueName))); + ScGlobal::getCharClassPtr()->uppercase( rFilter.MatchValueName))); if (itMem == pDim->maChildMembersValueNames.end()) { // Specified member name not found, try locale independent value. - itMem = pDim->maChildMembersValues.find( ScGlobal::pCharClass->uppercase( rFilter.MatchValue)); + itMem = pDim->maChildMembersValues.find( ScGlobal::getCharClassPtr()->uppercase( rFilter.MatchValue)); if (itMem == pDim->maChildMembersValues.end()) // Specified member not found. @@ -250,8 +250,8 @@ const ScDPResultTree::ValuesType* ScDPResultTree::getResults( double ScDPResultTree::getLeafResult(const css::sheet::DataPilotFieldFilter& rFilter) const { NamePairType aPair( - ScGlobal::pCharClass->uppercase(rFilter.FieldName), - ScGlobal::pCharClass->uppercase(rFilter.MatchValueName)); + ScGlobal::getCharClassPtr()->uppercase(rFilter.FieldName), + ScGlobal::getCharClassPtr()->uppercase(rFilter.MatchValueName)); LeafValuesType::const_iterator it = maLeafValues.find(aPair); if (it != maLeafValues.end()) diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx index 673a1301cac1..0b0c49f9024a 100644 --- a/sc/source/core/data/dpshttab.cxx +++ b/sc/source/core/data/dpshttab.cxx @@ -264,7 +264,7 @@ const ScRange& ScSheetSourceDesc::GetSourceRange() const if (!pRangeName) break; - OUString aUpper = ScGlobal::pCharClass->uppercase(searchRangeName); + OUString aUpper = ScGlobal::getCharClassPtr()->uppercase(searchRangeName); const ScRangeData* pData = pRangeName->findByUpperName(aUpper); if (!pData) break; diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx index 235531299361..464f491ddd17 100644 --- a/sc/source/core/data/dputil.cxx +++ b/sc/source/core/data/dputil.cxx @@ -113,7 +113,7 @@ OUString ScDPUtil::getDateGroupName( case sheet::DataPilotFieldGroupBy::YEARS: return OUString::number(nValue); case sheet::DataPilotFieldGroupBy::QUARTERS: - return ScGlobal::pLocaleData->getQuarterAbbreviation(sal_Int16(nValue-1)); // nValue is 1-based + return ScGlobal::getLocaleDataPtr()->getQuarterAbbreviation(sal_Int16(nValue-1)); // nValue is 1-based case css::sheet::DataPilotFieldGroupBy::MONTHS: return ScGlobal::GetCalendar()->getDisplayName( i18n::CalendarDisplayIndex::MONTH, sal_Int16(nValue-1), 0); // 0-based, get short name @@ -138,7 +138,7 @@ OUString ScDPUtil::getDateGroupName( case sheet::DataPilotFieldGroupBy::MINUTES: case sheet::DataPilotFieldGroupBy::SECONDS: { - OUStringBuffer aBuf(ScGlobal::pLocaleData->getTimeSep()); + OUStringBuffer aBuf(ScGlobal::getLocaleDataPtr()->getTimeSep()); aBuf.append(getTwoDigitString(nValue)); return aBuf.makeStringAndClear(); } diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 6b7c06e5fc2d..c535a9b7d8e9 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -80,8 +80,6 @@ ScUserList* ScGlobal::pUserList = nullptr; LanguageType ScGlobal::eLnge = LANGUAGE_SYSTEM; std::atomic<css::lang::Locale*> ScGlobal::pLocale(nullptr); SvtSysLocale* ScGlobal::pSysLocale = nullptr; -const CharClass* ScGlobal::pCharClass = nullptr; -const LocaleDataWrapper* ScGlobal::pLocaleData = nullptr; CalendarWrapper* ScGlobal::pCalendar = nullptr; std::atomic<CollatorWrapper*> ScGlobal::pCollator(nullptr); std::atomic<CollatorWrapper*> ScGlobal::pCaseCollator(nullptr); @@ -446,8 +444,6 @@ void ScGlobal::Init() // FIXME: If the sort-order etc. should depend the installed Office version // use Application::GetSettings().GetUILanguage() here pSysLocale = new SvtSysLocale; - pCharClass = pSysLocale->GetCharClassPtr(); - pLocaleData = pSysLocale->GetLocaleDataPtr(); pEmptyBrushItem = new SvxBrushItem( COL_TRANSPARENT, ATTR_BACKGROUND ); pButtonBrushItem = new SvxBrushItem( Color(), ATTR_BACKGROUND ); @@ -556,10 +552,6 @@ void ScGlobal::Clear() delete pCaseCollator.load(); pCaseCollator = nullptr; delete pCollator.load(); pCollator = nullptr; DELETEZ(pCalendar); - // Do NOT delete pCharClass since it is a pointer to the single SvtSysLocale instance ! - pCharClass = nullptr; - // Do NOT delete pLocaleData since it is a pointer to the single SvtSysLocale instance ! - pLocaleData = nullptr; DELETEZ(pSysLocale); delete pLocale.load(); pLocale = nullptr; DELETEZ(pStrClipDocName); @@ -1016,13 +1008,24 @@ utl::TransliterationWrapper* ScGlobal::GetpTransliteration() }); } -const LocaleDataWrapper* ScGlobal::GetpLocaleData() +const LocaleDataWrapper* ScGlobal::getLocaleDataPtr() { OSL_ENSURE( - pLocaleData, - "ScGlobal::GetpLocaleData() called before ScGlobal::Init()"); - return pLocaleData; + pSysLocale, + "ScGlobal::getLocaleDataPtr() called before ScGlobal::Init()"); + + return pSysLocale->GetLocaleDataPtr(); } + +const CharClass* ScGlobal::getCharClassPtr() +{ + OSL_ENSURE( + pSysLocale, + "ScGlobal::getCharClassPtr() called before ScGlobal::Init()"); + + return pSysLocale->GetCharClassPtr(); +} + CalendarWrapper* ScGlobal::GetCalendar() { assert(!bThreadedGroupCalcInProgress); diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx index 6306cba96768..04f587d4df5e 100644 --- a/sc/source/core/data/globalx.cxx +++ b/sc/source/core/data/globalx.cxx @@ -125,7 +125,7 @@ OUString ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber) xOrdinalSuffix = i18n::OrdinalSuffix::create( ::comphelper::getProcessComponentContext() ); } uno::Sequence< OUString > aSuffixes = xOrdinalSuffix->getOrdinalSuffix( nNumber, - ScGlobal::pLocaleData->getLanguageTag().getLocale()); + ScGlobal::getLocaleDataPtr()->getLanguageTag().getLocale()); if ( aSuffixes.hasElements() ) return aSuffixes[0]; else diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index 89763e52a0a3..e063f6a83da1 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -891,7 +891,7 @@ void ScPostIt::SetAuthor( const OUString& rAuthor ) void ScPostIt::AutoStamp() { - maNoteData.maDate = ScGlobal::pLocaleData->getDate( Date( Date::SYSTEM ) ); + maNoteData.maDate = ScGlobal::getLocaleDataPtr()->getDate( Date( Date::SYSTEM ) ); maNoteData.maAuthor = SvtUserOptions().GetID(); } diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 47382249bbcc..982dd2314434 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -380,7 +380,7 @@ namespace { struct CaseInsensitiveNamePredicate : svl::StyleSheetPredicate { CaseInsensitiveNamePredicate(const OUString& rName, SfxStyleFamily eFam) - : mUppercaseName(ScGlobal::pCharClass->uppercase(rName)), mFamily(eFam) + : mUppercaseName(ScGlobal::getCharClassPtr()->uppercase(rName)), mFamily(eFam) { } @@ -389,7 +389,7 @@ struct CaseInsensitiveNamePredicate : svl::StyleSheetPredicate { if (rStyleSheet.GetFamily() == mFamily) { - OUString aUpName = ScGlobal::pCharClass->uppercase(rStyleSheet.GetName()); + OUString aUpName = ScGlobal::getCharClassPtr()->uppercase(rStyleSheet.GetName()); if (mUppercaseName == aUpName) { return true; diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 0b25f838d676..61624ed2c255 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -352,7 +352,7 @@ void ScTable::SetName( const OUString& rNewName ) const OUString& ScTable::GetUpperName() const { if (aUpperName.isEmpty() && !aName.isEmpty()) - aUpperName = ScGlobal::pCharClass->uppercase(aName); + aUpperName = ScGlobal::getCharClassPtr()->uppercase(aName); return aUpperName; } diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index cb0aabf72628..d27afaf4fd63 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -3861,7 +3861,7 @@ bool ScTable::RefVisible(const ScFormulaCell* pCell) void ScTable::GetUpperCellString(SCCOL nCol, SCROW nRow, OUString& rStr) { GetInputString(nCol, nRow, rStr); - rStr = ScGlobal::pCharClass->uppercase(rStr.trim()); + rStr = ScGlobal::getCharClassPtr()->uppercase(rStr.trim()); } // Calculate the size of the sheet and set the size on DrawPage diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 74d286684c04..8858a161a501 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -107,7 +107,7 @@ static bool SplitString( const OUString &sWhole, sal_Int32 nPos = 0; while (nPos < sWhole.getLength()) { - const sal_uInt16 nType = ScGlobal::pCharClass->getCharacterType( sWhole, nPos); + const sal_uInt16 nType = ScGlobal::getCharClassPtr()->getCharacterType( sWhole, nPos); if (nType & KCharacterType::DIGIT) break; sWhole.iterateCodePoints( &nPos ); @@ -118,8 +118,8 @@ static bool SplitString( const OUString &sWhole, return false; // Get numeral element - const OUString& sUser = ScGlobal::pLocaleData->getNumDecimalSep(); - ParseResult aPRNum = ScGlobal::pCharClass->parsePredefinedToken( + const OUString& sUser = ScGlobal::getLocaleDataPtr()->getNumDecimalSep(); + ParseResult aPRNum = ScGlobal::getCharClassPtr()->parsePredefinedToken( KParseType::ANY_NUMBER, sWhole, nPos, KParseTokens::ANY_NUMBER, "", KParseTokens::ANY_NUMBER, sUser ); @@ -2003,7 +2003,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) { GetString( nGroupCol[i], nStartRow, aSubString ); if ( bIgnoreCase ) - aCompString[i] = ScGlobal::pCharClass->uppercase( aSubString ); + aCompString[i] = ScGlobal::getCharClassPtr()->uppercase( aSubString ); else aCompString[i] = aSubString; } // aSubString stays on the last @@ -2023,7 +2023,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) { GetString( nGroupCol[i], nRow, aString ); if (bIgnoreCase) - aString = ScGlobal::pCharClass->uppercase(aString); + aString = ScGlobal::getCharClassPtr()->uppercase(aString); // when sorting, blanks are separate group // otherwise blank cells are allowed below bChanged = ( ( !aString.isEmpty() || rParam.bDoSort ) && @@ -2083,7 +2083,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) { GetString( nGroupCol[i], nRow, aSubString ); if ( bIgnoreCase ) - aCompString[i] = ScGlobal::pCharClass->uppercase( aSubString ); + aCompString[i] = ScGlobal::getCharClassPtr()->uppercase( aSubString ); else aCompString[i] = aSubString; } diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 139f8f77453d..18bd1794898d 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -92,8 +92,8 @@ ScUnoAddInFuncData::ScUnoAddInFuncData( const OUString& rNam, const OUString& rL pArgDescs[i] = pAD[i]; } - aUpperName = ScGlobal::pCharClass->uppercase(aUpperName); - aUpperLocal = ScGlobal::pCharClass->uppercase(aUpperLocal); + aUpperName = ScGlobal::getCharClassPtr()->uppercase(aUpperName); + aUpperLocal = ScGlobal::getCharClassPtr()->uppercase(aUpperLocal); } ScUnoAddInFuncData::~ScUnoAddInFuncData() @@ -570,7 +570,7 @@ bool ScUnoAddInCollection::GetCalcName( const OUString& rExcelName, OUString& rR if (!bInitialized) Initialize(); - OUString aUpperCmp = ScGlobal::pCharClass->uppercase(rExcelName); + OUString aUpperCmp = ScGlobal::getCharClassPtr()->uppercase(rExcelName); for (long i=0; i<nFuncCount; i++) { @@ -580,7 +580,7 @@ bool ScUnoAddInCollection::GetCalcName( const OUString& rExcelName, OUString& rR const ::std::vector<ScUnoAddInFuncData::LocalizedName>& rNames = pFuncData->GetCompNames(); auto bFound = std::any_of(rNames.begin(), rNames.end(), [&aUpperCmp](const ScUnoAddInFuncData::LocalizedName& rName) { - return ScGlobal::pCharClass->uppercase( rName.maName ) == aUpperCmp; }); + return ScGlobal::getCharClassPtr()->uppercase( rName.maName ) == aUpperCmp; }); if (bFound) { //TODO: store upper case for comparing? diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx index 65c0afa18ef4..8913e14c53ef 100644 --- a/sc/source/core/tool/chgviset.cxx +++ b/sc/source/core/tool/chgviset.cxx @@ -99,7 +99,7 @@ void ScChangeViewSettings::SetTheComment(const OUString& rString) utl::SearchParam aSearchParam( rString, utl::SearchParam::SearchType::Regexp,false ); - pCommentSearcher.reset( new utl::TextSearch( aSearchParam, *ScGlobal::pCharClass ) ); + pCommentSearcher.reset( new utl::TextSearch( aSearchParam, *ScGlobal::getCharClassPtr() ) ); } } diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 8da7bbdd14b5..a9dcf4fa75b0 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -178,7 +178,7 @@ void ScCompiler::DeInit() bool ScCompiler::IsEnglishSymbol( const OUString& rName ) { // function names are always case-insensitive - OUString aUpper = ScGlobal::pCharClass->uppercase(rName); + OUString aUpper = ScGlobal::getCharClassPtr()->uppercase(rName); // 1. built-in function name OpCode eOp = ScCompiler::GetEnglishOpCode( aUpper ); @@ -272,7 +272,7 @@ void ScCompiler::SetFormulaLanguage( const ScCompiler::OpCodeMapPtr & xMap ) pCharClass = pCharClassEnglish; } else - pCharClass = ScGlobal::pCharClass; + pCharClass = ScGlobal::getCharClassPtr(); SetGrammarAndRefConvention( mxSymbols->getGrammar(), GetGrammar()); } } @@ -1795,7 +1795,7 @@ ScCompiler::ScCompiler( sc::CompileFormulaContext& rCxt, const ScAddress& rPos, mpInterpreterContext(pContext), mnCurrentSheetTab(-1), mnCurrentSheetEndPos(0), - pCharClass(ScGlobal::pCharClass), + pCharClass(ScGlobal::getCharClassPtr()), mnPredetectedReference(0), mnRangeOpPosInSymbol(-1), pConv(GetRefConvention(FormulaGrammar::CONV_OOO)), @@ -1818,7 +1818,7 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos, ScTokenArr mnCurrentSheetTab(-1), mnCurrentSheetEndPos(0), nSrcPos(0), - pCharClass( ScGlobal::pCharClass ), + pCharClass( ScGlobal::getCharClassPtr() ), mnPredetectedReference(0), mnRangeOpPosInSymbol(-1), pConv( GetRefConvention( FormulaGrammar::CONV_OOO ) ), @@ -1840,7 +1840,7 @@ ScCompiler::ScCompiler( sc::CompileFormulaContext& rCxt, const ScAddress& rPos, mpInterpreterContext(pContext), mnCurrentSheetTab(-1), mnCurrentSheetEndPos(0), - pCharClass(ScGlobal::pCharClass), + pCharClass(ScGlobal::getCharClassPtr()), mnPredetectedReference(0), mnRangeOpPosInSymbol(-1), pConv(GetRefConvention(FormulaGrammar::CONV_OOO)), @@ -1863,7 +1863,7 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos, mnCurrentSheetTab(-1), mnCurrentSheetEndPos(0), nSrcPos(0), - pCharClass( ScGlobal::pCharClass ), + pCharClass( ScGlobal::getCharClassPtr() ), mnPredetectedReference(0), mnRangeOpPosInSymbol(-1), pConv( GetRefConvention( FormulaGrammar::CONV_OOO ) ), @@ -1885,7 +1885,7 @@ void ScCompiler::CheckTabQuotes( OUString& rString, { sal_Int32 nStartFlags = KParseTokens::ANY_LETTER_OR_NUMBER | KParseTokens::ASC_UNDERSCORE; sal_Int32 nContFlags = nStartFlags; - ParseResult aRes = ScGlobal::pCharClass->parsePredefinedToken( + ParseResult aRes = ScGlobal::getCharClassPtr()->parsePredefinedToken( KParseType::IDENTNAME, rString, 0, nStartFlags, EMPTY_OUSTRING, nContFlags, EMPTY_OUSTRING); bool bNeedsQuote = !((aRes.TokenType & KParseType::IDENTNAME) && aRes.EndPos == rString.getLength()); @@ -2077,8 +2077,8 @@ sal_Int32 ScCompiler::NextSymbol(bool bInArray) sal_Unicode cSep = mxSymbols->getSymbolChar( ocSep); sal_Unicode cArrayColSep = mxSymbols->getSymbolChar( ocArrayColSep); sal_Unicode cArrayRowSep = mxSymbols->getSymbolChar( ocArrayRowSep); - sal_Unicode cDecSep = (mxSymbols->isEnglish() ? '.' : ScGlobal::pLocaleData->getNumDecimalSep()[0]); - sal_Unicode cDecSepAlt = (mxSymbols->isEnglish() ? 0 : ScGlobal::pLocaleData->getNumDecimalSepAlt().toChar()); + sal_Unicode cDecSep = (mxSymbols->isEnglish() ? '.' : ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0]); + sal_Unicode cDecSepAlt = (mxSymbols->isEnglish() ? 0 : ScGlobal::getLocaleDataPtr()->getNumDecimalSepAlt().toChar()); // special symbols specific to address convention used sal_Unicode cSheetPrefix = pConv->getSpecialSymbol(ScCompiler::Convention::ABS_SHEET_PREFIX); @@ -2689,7 +2689,7 @@ Label_MaskStateMachine: // the bi18n case (which we don't want to include as yet another // special case above as it is rare enough and doesn't generally occur // in formulas). - const sal_Unicode cGroupSep = ScGlobal::pLocaleData->getNumThousandSep()[0]; + const sal_Unicode cGroupSep = ScGlobal::getLocaleDataPtr()->getNumThousandSep()[0]; const bool bGroupSeparator = (128 <= cGroupSep && cGroupSep != cSep && cGroupSep != cArrayColSep && cGroupSep != cArrayRowSep && cGroupSep != cDecSep && cGroupSep != cDecSepAlt && @@ -3275,14 +3275,14 @@ bool ScCompiler::IsReference( const OUString& rName, const OUString* pErrRef ) { // Has to be called before IsValue sal_Unicode ch1 = rName[0]; - sal_Unicode cDecSep = ( mxSymbols->isEnglish() ? '.' : ScGlobal::pLocaleData->getNumDecimalSep()[0] ); + sal_Unicode cDecSep = ( mxSymbols->isEnglish() ? '.' : ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0] ); if ( ch1 == cDecSep ) return false; // Code further down checks only if cDecSep=='.' so simply obtaining the // alternative decimal separator if it's not is sufficient. if (cDecSep != '.') { - cDecSep = ScGlobal::pLocaleData->getNumDecimalSepAlt().toChar(); + cDecSep = ScGlobal::getLocaleDataPtr()->getNumDecimalSepAlt().toChar(); if ( ch1 == cDecSep ) return false; } @@ -4164,7 +4164,7 @@ static bool lcl_UpperAsciiOrI18n( OUString& rUpper, const OUString& rOrg, Formul } else { - rUpper = ScGlobal::pCharClass->uppercase(rOrg); + rUpper = ScGlobal::getCharClassPtr()->uppercase(rOrg); return false; } } @@ -4258,7 +4258,7 @@ bool ScCompiler::NextNewToken( bool bInArray ) else { OUString aTmpStr( cSymbol[0] ); - bMayBeFuncName = ScGlobal::pCharClass->isLetter( aTmpStr, 0 ); + bMayBeFuncName = ScGlobal::getCharClassPtr()->isLetter( aTmpStr, 0 ); bAsciiNonAlnum = false; } if (bAsciiNonAlnum && cSymbol[1] == 0) @@ -4363,7 +4363,7 @@ bool ScCompiler::NextNewToken( bool bInArray ) // User defined names and such do need i18n upper also in ODF. if (bAsciiUpper) - aUpper = ScGlobal::pCharClass->uppercase( aOrg ); + aUpper = ScGlobal::getCharClassPtr()->uppercase( aOrg ); if (IsNamedRange( aUpper )) return true; @@ -4421,7 +4421,7 @@ bool ScCompiler::NextNewToken( bool bInArray ) // Provide single token information and continue. Do not set an error, that // would prematurely end compilation. Simple unknown names are handled by // the interpreter. - aUpper = ScGlobal::pCharClass->lowercase( aUpper ); + aUpper = ScGlobal::getCharClassPtr()->lowercase( aUpper ); svl::SharedString aSS = pDoc->GetSharedStringPool().intern(aUpper); maRawToken.SetString(aSS.getData(), aSS.getDataIgnoreCase()); maRawToken.NewOpCode( ocBad ); @@ -5004,7 +5004,7 @@ bool ScCompiler::IsCharFlagAllConventions( return true; } else - return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos ); + return ScGlobal::getCharClassPtr()->isLetterNumeric( rStr, nPos ); } void ScCompiler::CreateStringFromExternal( OUStringBuffer& rBuffer, const FormulaToken* pTokenP ) const @@ -5276,7 +5276,7 @@ void ScCompiler::LocalizeString( OUString& rName ) const // quote characters contained within are escaped by '\\'. bool ScCompiler::EnQuote( OUString& rStr ) { - sal_Int32 nType = ScGlobal::pCharClass->getStringType( rStr, 0, rStr.getLength() ); + sal_Int32 nType = ScGlobal::getCharClassPtr()->getStringType( rStr, 0, rStr.getLength() ); if ( !CharClass::isNumericType( nType ) && CharClass::isAlphaNumericType( nType ) ) return false; diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 80476b494fa9..1a0d7b98e297 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -85,7 +85,7 @@ ScDBData::ScDBData( const OUString& rName, mbTableColumnNamesDirty(true), nFilteredRowCount(0) { - aUpper = ScGlobal::pCharClass->uppercase(aUpper); + aUpper = ScGlobal::getCharClassPtr()->uppercase(aUpper); } ScDBData::ScDBData( const ScDBData& rData ) : @@ -154,7 +154,7 @@ ScDBData::ScDBData( const OUString& rName, const ScDBData& rData ) : mbTableColumnNamesDirty (rData.mbTableColumnNamesDirty), nFilteredRowCount (rData.nFilteredRowCount) { - aUpper = ScGlobal::pCharClass->uppercase(aUpper); + aUpper = ScGlobal::getCharClassPtr()->uppercase(aUpper); } ScDBData& ScDBData::operator= (const ScDBData& rData) diff --git a/sc/source/core/tool/doubleref.cxx b/sc/source/core/tool/doubleref.cxx index 2a2316a0c173..267f762dd311 100644 --- a/sc/source/core/tool/doubleref.cxx +++ b/sc/source/core/tool/doubleref.cxx @@ -42,7 +42,7 @@ namespace { void lcl_uppercase(OUString& rStr) { - rStr = ScGlobal::pCharClass->uppercase(rStr.trim()); + rStr = ScGlobal::getCharClassPtr()->uppercase(rStr.trim()); } bool lcl_createStarQuery( @@ -190,7 +190,7 @@ bool lcl_createExcelQuery( while (nCol < nCols) { aCellStr = pQueryRef->getString(nCol, nRow); - aCellStr = ScGlobal::pCharClass->uppercase( aCellStr ); + aCellStr = ScGlobal::getCharClassPtr()->uppercase( aCellStr ); if (!aCellStr.isEmpty()) { if (nIndex < nNewEntries) diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 4e64fd8cc08a..bf050cb93e35 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -241,7 +241,7 @@ OUString ScEditUtil::GetCellFieldValue( case text::textfield::Type::DATE: { Date aDate(Date::SYSTEM); - aRet = ScGlobal::pLocaleData->getDate(aDate); + aRet = ScGlobal::getLocaleDataPtr()->getDate(aDate); } break; case text::textfield::Type::DOCINFO_TITLE: @@ -815,7 +815,7 @@ OUString ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField, case text::textfield::Type::EXTENDED_TIME: case text::textfield::Type::TIME: // For now, time field in the header / footer is always dynamic. - aRet = ScGlobal::pLocaleData->getTime(aData.aDateTime); + aRet = ScGlobal::getLocaleDataPtr()->getTime(aData.aDateTime); break; case text::textfield::Type::DOCINFO_TITLE: aRet = aData.aTitle; @@ -836,7 +836,7 @@ OUString ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField, aRet = aData.aTabName; break; case text::textfield::Type::DATE: - aRet = ScGlobal::pLocaleData->getDate(aData.aDateTime); + aRet = ScGlobal::getLocaleDataPtr()->getDate(aData.aDateTime); break; default: aRet = "?"; diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx index cee35333f0a9..c93059f5f087 100644 --- a/sc/source/core/tool/formulaopt.cxx +++ b/sc/source/core/tool/formulaopt.cxx @@ -62,7 +62,7 @@ void ScFormulaOptions::GetDefaultFormulaSeparators( // the old separator set. return; - const LocaleDataWrapper& rLocaleData = *ScGlobal::pLocaleData; + const LocaleDataWrapper& rLocaleData = *ScGlobal::getLocaleDataPtr(); const OUString& rDecSep = rLocaleData.getNumDecimalSep(); const OUString& rListSep = rLocaleData.getListSep(); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index f52ac8916069..df67f6cde921 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -3165,7 +3165,7 @@ void ScInterpreter::ScTrim() void ScInterpreter::ScUpper() { - OUString aString = ScGlobal::pCharClass->uppercase(GetString().getString()); + OUString aString = ScGlobal::getCharClassPtr()->uppercase(GetString().getString()); PushString(aString); } @@ -3176,14 +3176,14 @@ void ScInterpreter::ScProper() const sal_Int32 nLen = aStr.getLength(); if ( nLen > 0 ) { - OUString aUpr(ScGlobal::pCharClass->uppercase(aStr.toString())); - OUString aLwr(ScGlobal::pCharClass->lowercase(aStr.toString())); + OUString aUpr(ScGlobal::getCharClassPtr()->uppercase(aStr.toString())); + OUString aLwr(ScGlobal::getCharClassPtr()->lowercase(aStr.toString())); aStr[0] = aUpr[0]; sal_Int32 nPos = 1; while( nPos < nLen ) { OUString aTmpStr( aStr[nPos-1] ); - if ( !ScGlobal::pCharClass->isLetter( aTmpStr, 0 ) ) + if ( !ScGlobal::getCharClassPtr()->isLetter( aTmpStr, 0 ) ) aStr[nPos] = aUpr[nPos]; else aStr[nPos] = aLwr[nPos]; @@ -3195,7 +3195,7 @@ void ScInterpreter::ScProper() void ScInterpreter::ScLower() { - OUString aString = ScGlobal::pCharClass->lowercase(GetString().getString()); + OUString aString = ScGlobal::getCharClassPtr()->lowercase(GetString().getString()); PushString(aString); } @@ -8142,7 +8142,7 @@ void ScInterpreter::ScIndirect() do { - OUString aName( ScGlobal::pCharClass->uppercase( sRefStr)); + OUString aName( ScGlobal::getCharClassPtr()->uppercase( sRefStr)); ScDBCollection::NamedDBs& rDBs = pDok->GetDBCollection()->getNamedDBs(); const ScDBData* pData = rDBs.findByUpperName( aName); if (!pData) @@ -9220,7 +9220,7 @@ void ScInterpreter::ScSearchB() sal_Int32 nEndPos = aSubStr.getLength(); utl::SearchParam::SearchType eSearchType = DetectSearchType( asStr, pDok ); utl::SearchParam sPar( asStr, eSearchType, false, '~', false ); - utl::TextSearch sT( sPar, *ScGlobal::pCharClass ); + utl::TextSearch sT( sPar, *ScGlobal::getCharClassPtr() ); if ( !sT.SearchForward( aSubStr, &nPos, &nEndPos ) ) PushNoValue(); else @@ -9296,7 +9296,7 @@ void ScInterpreter::ScSearch() { utl::SearchParam::SearchType eSearchType = DetectSearchType( SearchStr, pDok ); utl::SearchParam sPar(SearchStr, eSearchType, false, '~', false); - utl::TextSearch sT( sPar, *ScGlobal::pCharClass ); + utl::TextSearch sT( sPar, *ScGlobal::getCharClassPtr() ); bool bBool = sT.SearchForward(sStr, &nPos, &nEndPos); if (!bBool) PushNoValue(); diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 7f65d634c3fe..0369ae5f192a 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -2517,7 +2517,7 @@ void ScInterpreter::ScExternal() { sal_uInt8 nParamCount = GetByte(); OUString aUnoName; - OUString aFuncName( ScGlobal::pCharClass->uppercase( pCur->GetExternal() ) ); + OUString aFuncName( ScGlobal::getCharClassPtr()->uppercase( pCur->GetExternal() ) ); LegacyFuncData* pLegacyFuncData = ScGlobal::GetLegacyFuncCollection()->findByName(aFuncName); if (pLegacyFuncData) { diff --git a/sc/source/core/tool/numformat.cxx b/sc/source/core/tool/numformat.cxx index ec8bf642e5a6..ce3df323f80d 100644 --- a/sc/source/core/tool/numformat.cxx +++ b/sc/source/core/tool/numformat.cxx @@ -50,7 +50,7 @@ bool NumFmtUtil::isLatinScript( sal_uLong nFormat, ScDocument& rDoc ) OUString aDecSep; LanguageType nFormatLang = pFormat->GetLanguage(); if (nFormatLang == LANGUAGE_SYSTEM) - aDecSep = ScGlobal::pLocaleData->getNumDecimalSep(); + aDecSep = ScGlobal::getLocaleDataPtr()->getNumDecimalSep(); else { LocaleDataWrapper aLocaleData( diff --git a/sc/source/core/tool/optutil.cxx b/sc/source/core/tool/optutil.cxx index 1b2ed90d0e0c..f445c20a9c06 100644 --- a/sc/source/core/tool/optutil.cxx +++ b/sc/source/core/tool/optutil.cxx @@ -31,7 +31,7 @@ bool ScOptionsUtil::IsMetricSystem() //TODO: which language should be used here - system language or installed office language? - MeasurementSystem eSys = ScGlobal::pLocaleData->getMeasurementSystemEnum(); + MeasurementSystem eSys = ScGlobal::getLocaleDataPtr()->getMeasurementSystemEnum(); return ( eSys == MeasurementSystem::Metric ); } diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx index f285df49b632..356611c24b83 100644 --- a/sc/source/core/tool/parclass.cxx +++ b/sc/source/core/tool/parclass.cxx @@ -399,7 +399,7 @@ formula::ParamClass ScParameterClassification::GetExternalParameterType( const f return eRet; // similar to ScInterpreter::ScExternal() - OUString aFuncName = ScGlobal::pCharClass->uppercase( pToken->GetExternal()); + OUString aFuncName = ScGlobal::getCharClassPtr()->uppercase( pToken->GetExternal()); { const LegacyFuncData* pLegacyFuncData = ScGlobal::GetLegacyFuncCollection()->findByName(aFuncName); if (pLegacyFuncData) diff --git a/sc/source/core/tool/queryentry.cxx b/sc/source/core/tool/queryentry.cxx index ecc912b34c4a..6ebcf0003e9b 100644 --- a/sc/source/core/tool/queryentry.cxx +++ b/sc/source/core/tool/queryentry.cxx @@ -162,7 +162,7 @@ utl::TextSearch* ScQueryEntry::GetSearchTextPtr( utl::SearchParam::SearchType eS OUString aStr = maQueryItems[0].maString.getString(); pSearchParam.reset(new utl::SearchParam( aStr, eSearchType, bCaseSens, '~', bWildMatchSel)); - pSearchText.reset(new utl::TextSearch( *pSearchParam, *ScGlobal::pCharClass )); + pSearchText.reset(new utl::TextSearch( *pSearchParam, *ScGlobal::getCharClassPtr() )); } return pSearchText.get(); } diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx index 88596fec0e3b..b799a6ad0353 100644 --- a/sc/source/core/tool/rangenam.cxx +++ b/sc/source/core/tool/rangenam.cxx @@ -51,7 +51,7 @@ ScRangeData::ScRangeData( ScDocument* pDok, Type nType, const FormulaGrammar::Grammar eGrammar ) : aName ( rName ), - aUpperName ( ScGlobal::pCharClass->uppercase( rName ) ), + aUpperName ( ScGlobal::getCharClassPtr()->uppercase( rName ) ), aPos ( rAddress ), eType ( nType ), pDoc ( pDok ), @@ -85,7 +85,7 @@ ScRangeData::ScRangeData( ScDocument* pDok, const ScAddress& rAddress, Type nType ) : aName ( rName ), - aUpperName ( ScGlobal::pCharClass->uppercase( rName ) ), + aUpperName ( ScGlobal::getCharClassPtr()->uppercase( rName ) ), pCode ( new ScTokenArray( rArr ) ), aPos ( rAddress ), eType ( nType ), @@ -102,7 +102,7 @@ ScRangeData::ScRangeData( ScDocument* pDok, const OUString& rName, const ScAddress& rTarget ) : aName ( rName ), - aUpperName ( ScGlobal::pCharClass->uppercase( rName ) ), + aUpperName ( ScGlobal::getCharClassPtr()->uppercase( rName ) ), pCode ( new ScTokenArray(pDok) ), aPos ( rTarget ), eType ( Type::Name ), diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index 8d398e1391ae..b09c0e18dd32 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -267,7 +267,7 @@ bool ScRangeUtil::MakeRangeFromName ( //then check for local range names ScRangeName* pRangeNames = pDoc->GetRangeName( nTable ); ScRangeData* pData = nullptr; - aName = ScGlobal::pCharClass->uppercase(aName); + aName = ScGlobal::getCharClassPtr()->uppercase(aName); if ( pRangeNames ) pData = pRangeNames->findByUpperName(aName); if (!pData) @@ -308,7 +308,7 @@ bool ScRangeUtil::MakeRangeFromName ( else if( eScope==RUTL_DBASE ) { ScDBCollection::NamedDBs& rDbNames = pDoc->GetDBCollection()->getNamedDBs(); - ScDBData* pData = rDbNames.findByUpperName(ScGlobal::pCharClass->uppercase(rName)); + ScDBData* pData = rDbNames.findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rName)); if (pData) { pData->GetArea(nTab, nColStart, nRowStart, nColEnd, nRowEnd); @@ -900,7 +900,7 @@ ScRangeData* ScRangeStringConverter::GetRangeDataFromString(const OUString& rStr { ScRangeName* pLocalRangeName = pDoc->GetRangeName(nTab); ScRangeData* pData = nullptr; - OUString aUpperName = ScGlobal::pCharClass->uppercase(rString); + OUString aUpperName = ScGlobal::getCharClassPtr()->uppercase(rString); if(pLocalRangeName) { pData = pLocalRangeName->findByUpperName(aUpperName); diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index 60d6a163ec60..1a248b7c5914 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -69,7 +69,7 @@ void ScUserListData::InitTokens() if (nLen) { OUString aSub(p0, nLen); - OUString aUpStr = ScGlobal::pCharClass->uppercase(aSub); + OUString aUpStr = ScGlobal::getCharClassPtr()->uppercase(aSub); maSubStrings.emplace_back(aSub, aUpStr); } bFirst = true; @@ -79,7 +79,7 @@ void ScUserListData::InitTokens() if (nLen) { OUString aSub(p0, nLen); - OUString aUpStr = ScGlobal::pCharClass->uppercase(aSub); + OUString aUpStr = ScGlobal::getCharClassPtr()->uppercase(aSub); maSubStrings.emplace_back(aSub, aUpStr); } } @@ -124,7 +124,7 @@ bool ScUserListData::GetSubIndex(const OUString& rSubStr, sal_uInt16& rIndex, bo } // When that fails, do a case insensitive search. - OUString aUpStr = ScGlobal::pCharClass->uppercase(rSubStr); + OUString aUpStr = ScGlobal::getCharClassPtr()->uppercase(rSubStr); itr = ::std::find_if( maSubStrings.begin(), maSubStrings.end(), FindByName(aUpStr, true)); if (itr != maSubStrings.end()) @@ -205,7 +205,7 @@ ScUserList::ScUserList() uno::Sequence< i18n::CalendarItem2 > xCal; const uno::Sequence< i18n::Calendar2 > xCalendars( - ScGlobal::pLocaleData->getAllCalendars() ); + ScGlobal::getLocaleDataPtr()->getAllCalendars() ); for ( const auto& rCalendar : xCalendars ) { diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 67520923d96f..122a4ec952f3 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -478,7 +478,7 @@ OUString CreateFromDouble( double fVal ) { return rtl::math::doubleToUString(fVal, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - ScGlobal::pLocaleData->getNumDecimalSep()[0], true); + ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true); } } diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index 79b1d803d62f..e105d94a6313 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -325,7 +325,7 @@ void ScHTMLExport::WriteHeader() OUT_COMMENT( GLOBSTR( STR_DOC_INFO ) ); OUString aStrOut = GLOBSTR( STR_DOC_PRINTED ) + ": "; lcl_AddStamp( aStrOut, xDocProps->getPrintedBy(), - xDocProps->getPrintDate(), *ScGlobal::pLocaleData ); + xDocProps->getPrintDate(), *ScGlobal::getLocaleDataPtr() ); OUT_COMMENT( aStrOut ); } diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx index 7496530124cf..1b0bd9af2612 100644 --- a/sc/source/filter/html/htmlimp.cxx +++ b/sc/source/filter/html/htmlimp.cxx @@ -186,7 +186,7 @@ void ScHTMLImport::WriteToDocument( if (!pTable->GetTableName().isEmpty()) { OUString aName( ScfTools::GetNameFromHTMLName( pTable->GetTableName() ) ); - if (!mpDoc->GetRangeName()->findByUpperName(ScGlobal::pCharClass->uppercase(aName))) + if (!mpDoc->GetRangeName()->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName))) InsertRangeName( mpDoc, aName, aNewRange ); } } @@ -217,7 +217,7 @@ OUString ScHTMLImport::GetHTMLRangeNameList( const ScDocument* pDoc, const OUStr for(;;) { aToken = ScfTools::GetNameFromHTMLIndex( nIndex++ ); - const ScRangeData* pRangeData = pRangeNames->findByUpperName(ScGlobal::pCharClass->uppercase(aToken)); + const ScRangeData* pRangeData = pRangeNames->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aToken)); if (!pRangeData) break; ScRange aRange; diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index f651788be555..3e909f3c309c 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -376,7 +376,7 @@ OUString findUnusedName( const ScRangeName* pRangeName, const OUString& rSuggest { OUString aNewName = rSuggestedName; sal_Int32 nIndex = 0; - while(pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(aNewName))) + while(pRangeName->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aNewName))) aNewName = rSuggestedName + OUStringChar('_') + OUString::number( nIndex++ ); return aNewName; diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 92fbdc2a21f9..2c7e79b4f4a6 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -410,7 +410,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu bHasGraphics |= GraphicSize( nCol, nRow, pE ); if ( pE->pName ) { // Anchor Name => RangeName - if (!pRangeNames->findByUpperName(ScGlobal::pCharClass->uppercase(*pE->pName))) + if (!pRangeNames->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(*pE->pName))) { ScRangeData* pData = new ScRangeData( mpDoc, *pE->pName, ScAddress( nCol, nRow, nTab ) ); diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 2fa44cb3a9b9..3d81d18edaa8 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -1393,7 +1393,7 @@ ExcEScenario::ExcEScenario( const XclExpRoot& rRoot, SCTAB nTab ) sText = ::rtl::math::doubleToUString( fVal, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - ScGlobal::pLocaleData->getNumDecimalSep()[0], + ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true ); } else diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index b0131488e148..46321002fbf1 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1260,7 +1260,7 @@ bool ScInputHandler::GetFuncName( OUString& aStart, OUString& aResult ) if ( aStart.isEmpty() ) return false; - aStart = ScGlobal::pCharClass->uppercase( aStart ); + aStart = ScGlobal::getCharClassPtr()->uppercase( aStart ); sal_Int32 nPos = aStart.getLength() - 1; sal_Unicode c = aStart[ nPos ]; // fdo#75264 use maFormulaChar to check if characters are used in function names @@ -1426,7 +1426,7 @@ void ScInputHandler::UseFormulaData() return; if ( aParagraph.getLength() > aSel.nEndPos && - ( ScGlobal::pCharClass->isLetterNumeric( aParagraph, aSel.nEndPos ) || + ( ScGlobal::getCharClassPtr()->isLetterNumeric( aParagraph, aSel.nEndPos ) || aParagraph[ aSel.nEndPos ] == '_' || aParagraph[ aSel.nEndPos ] == '.' || aParagraph[ aSel.nEndPos ] == '$' ) ) @@ -3100,25 +3100,25 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode ) bInsertPreCorrectedString = false; OUString aReplace(pAuto->GetStartDoubleQuote()); if( aReplace.isEmpty() ) - aReplace = ScGlobal::pLocaleData->getDoubleQuotationMarkStart(); + aReplace = ScGlobal::getLocaleDataPtr()->getDoubleQuotationMarkStart(); if( aReplace != "\"" ) aString = aString.replaceAll( aReplace, "\"" ); aReplace = OUString(pAuto->GetEndDoubleQuote()); if( aReplace.isEmpty() ) - aReplace = ScGlobal::pLocaleData->getDoubleQuotationMarkEnd(); + aReplace = ScGlobal::getLocaleDataPtr()->getDoubleQuotationMarkEnd(); if( aReplace != "\"" ) aString = aString.replaceAll( aReplace, "\"" ); aReplace = OUString(pAuto->GetStartSingleQuote()); if( aReplace.isEmpty() ) - aReplace = ScGlobal::pLocaleData->getQuotationMarkStart(); + aReplace = ScGlobal::getLocaleDataPtr()->getQuotationMarkStart(); if( aReplace != "'" ) aString = aString.replaceAll( aReplace, "'" ); aReplace = OUString(pAuto->GetEndSingleQuote()); if( aReplace.isEmpty() ) - aReplace = ScGlobal::pLocaleData->getQuotationMarkEnd(); + aReplace = ScGlobal::getLocaleDataPtr()->getQuotationMarkEnd(); if( aReplace != "'" ) aString = aString.replaceAll( aReplace, "'"); } diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index bf80fc89b07f..cbbc8b2d0cf1 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -2329,7 +2329,7 @@ void ScPosWnd::DoEnter() { ScRangeName* pNames = rDoc.GetRangeName(); ScRange aSelection; - if ( pNames && !pNames->findByUpperName(ScGlobal::pCharClass->uppercase(aText)) && + if ( pNames && !pNames->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aText)) && (rViewData.GetSimpleArea( aSelection ) == SC_MARK_SIMPLE) ) { ScRangeName aNewRanges( *pNames ); diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index b9b5acca11c8..ce2137bf7fe4 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -1218,7 +1218,7 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, TriStateHdl, Button*, void) IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl, Edit&, void) { OUString aSearchText = maEdSearch->GetText(); - aSearchText = ScGlobal::pCharClass->lowercase( aSearchText ); + aSearchText = ScGlobal::getCharClassPtr()->lowercase( aSearchText ); bool bSearchTextEmpty = aSearchText.isEmpty(); size_t n = maMembers.size(); size_t nSelCount = 0; @@ -1237,9 +1237,9 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl, Edit&, void) if ( !bSearchTextEmpty ) { if ( !bIsDate ) - bPartialMatch = ( ScGlobal::pCharClass->lowercase( aLabelDisp ).indexOf( aSearchText ) != -1 ); + bPartialMatch = ( ScGlobal::getCharClassPtr()->lowercase( aLabelDisp ).indexOf( aSearchText ) != -1 ); else if ( maMembers[i].meDatePartType == ScCheckListMember::DAY ) // Match with both numerical and text version of month - bPartialMatch = (ScGlobal::pCharClass->lowercase( OUString( + bPartialMatch = (ScGlobal::getCharClassPtr()->lowercase( OUString( maMembers[i].maRealName + maMembers[i].maDateParts[1] )).indexOf( aSearchText ) != -1); else continue; diff --git a/sc/source/ui/cctrl/editfield.cxx b/sc/source/ui/cctrl/editfield.cxx index edf9a1e49545..28772daaf119 100644 --- a/sc/source/ui/cctrl/editfield.cxx +++ b/sc/source/ui/cctrl/editfield.cxx @@ -30,7 +30,7 @@ namespace { sal_Unicode lclGetDecSep() { - return ScGlobal::GetpLocaleData()->getNumDecimalSep()[0]; + return ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0]; } } // namespace @@ -48,7 +48,7 @@ bool ScDoubleField::GetValue( double& rfValue ) const { rtl_math_ConversionStatus eStatus; sal_Int32 nEnd; - rfValue = ScGlobal::GetpLocaleData()->stringToDouble( aStr, true, &eStatus, &nEnd ); + rfValue = ScGlobal::getLocaleDataPtr()->stringToDouble( aStr, true, &eStatus, &nEnd ); bOk = (eStatus == rtl_math_ConversionStatus_Ok) && (nEnd == aStr.getLength() ); } return bOk; diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 936e5b235a40..2d8cbef47848 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -454,14 +454,14 @@ void StyleSelect(weld::Window* pDialogParent, weld::ComboBox& rLbStyle, const Sc { for( sal_Int32 i = 1, n = rLbStyle.get_count(); i <= n && !bFound; ++i) { - OUString aStyleName = ScGlobal::pCharClass->uppercase(rLbStyle.get_text(i)); + OUString aStyleName = ScGlobal::getCharClassPtr()->uppercase(rLbStyle.get_text(i)); if( i == n ) { rLbStyle.append_text(aName); rLbStyle.set_active_text(aName); bFound = true; } - else if( aStyleName > ScGlobal::pCharClass->uppercase(aName) ) + else if( aStyleName > ScGlobal::getCharClassPtr()->uppercase(aName) ) { rLbStyle.insert_text(i, aName); rLbStyle.set_active_text(aName); diff --git a/sc/source/ui/dataprovider/dataprovider.cxx b/sc/source/ui/dataprovider/dataprovider.cxx index 3d0f56265be5..817ffce44236 100644 --- a/sc/source/ui/dataprovider/dataprovider.cxx +++ b/sc/source/ui/dataprovider/dataprovider.cxx @@ -262,7 +262,7 @@ void ScDBDataManager::SetDatabase(const OUString& rDBName) ScDBData* ScDBDataManager::getDBData() { - ScDBData* pDBData = mpDoc->GetDBCollection()->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(maDBName)); + ScDBData* pDBData = mpDoc->GetDBCollection()->getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(maDBName)); return pDBData; } diff --git a/sc/source/ui/dataprovider/datatransformation.cxx b/sc/source/ui/dataprovider/datatransformation.cxx index 01a541e110d8..0d5cc107ef33 100644 --- a/sc/source/ui/dataprovider/datatransformation.cxx +++ b/sc/source/ui/dataprovider/datatransformation.cxx @@ -212,7 +212,7 @@ void TextTransformation::Transform(ScDocument& rDoc) const if (eType == CELLTYPE_STRING) { OUString aStr = rDoc.GetString(rCol, nRow, 0); - rDoc.SetString(rCol, nRow, 0, ScGlobal::pCharClass->lowercase(aStr)); + rDoc.SetString(rCol, nRow, 0, ScGlobal::getCharClassPtr()->lowercase(aStr)); } } } @@ -226,7 +226,7 @@ void TextTransformation::Transform(ScDocument& rDoc) const if (eType == CELLTYPE_STRING) { OUString aStr = rDoc.GetString(rCol, nRow, 0); - rDoc.SetString(rCol, nRow, 0, ScGlobal::pCharClass->uppercase(aStr)); + rDoc.SetString(rCol, nRow, 0, ScGlobal::getCharClassPtr()->uppercase(aStr)); } } } @@ -244,16 +244,16 @@ void TextTransformation::Transform(ScDocument& rDoc) const sal_Int32 length = aStr.getLength(); if(length != 0) - aStr = aStr.replaceAt(0, 1, ScGlobal::pCharClass->uppercase(OUString(aStr[0]))); + aStr = aStr.replaceAt(0, 1, ScGlobal::getCharClassPtr()->uppercase(OUString(aStr[0]))); for (sal_Int32 i = 1; i < length; i++){ if (aStr[i-1] == sal_Unicode(U' ')) { - aStr = aStr.replaceAt(i, 1, ScGlobal::pCharClass->uppercase(OUString(aStr[i]))); + aStr = aStr.replaceAt(i, 1, ScGlobal::getCharClassPtr()->uppercase(OUString(aStr[i]))); } else { - aStr = aStr.replaceAt(i, 1, ScGlobal::pCharClass->lowercase(OUString(aStr[i]))); + aStr = aStr.replaceAt(i, 1, ScGlobal::getCharClassPtr()->lowercase(OUString(aStr[i]))); } } rDoc.SetString(rCol, nRow, 0, aStr); diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index 295f1d428927..6e04622e43f0 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -341,7 +341,7 @@ void ScDbNameDlg::UpdateNames() void ScDbNameDlg::UpdateDBData( const OUString& rStrName ) { - const ScDBData* pData = aLocalDbCol.getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rStrName)); + const ScDBData* pData = aLocalDbCol.getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rStrName)); if ( pData ) { @@ -417,7 +417,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, weld::Button&, void) ScAddress aStart = theCurArea.aStart; ScAddress aEnd = theCurArea.aEnd; - ScDBData* pOldEntry = aLocalDbCol.getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(aNewName)); + ScDBData* pOldEntry = aLocalDbCol.getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aNewName)); if (pOldEntry) { // modify area diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx index fe0cd0b9b889..5a30dcec7c07 100644 --- a/sc/source/ui/dbgui/scendlg.cxx +++ b/sc/source/ui/dbgui/scendlg.cxx @@ -62,8 +62,8 @@ ScNewScenarioDlg::ScNewScenarioDlg(weld::Window* pParent, const OUString& rName, OUString sOn(m_xOnFt->get_label()); OUString aComment(sCreatedBy + " " + aUserOpt.GetFirstName() + " " +aUserOpt.GetLastName() - + ", " + sOn + " " + ScGlobal::GetpLocaleData()->getDate(Date(Date::SYSTEM)) - + ", " + ScGlobal::GetpLocaleData()->getTime(tools::Time(tools::Time::SYSTEM))); + + ", " + sOn + " " + ScGlobal::getLocaleDataPtr()->getDate(Date(Date::SYSTEM)) + + ", " + ScGlobal::getLocaleDataPtr()->getTime(tools::Time(tools::Time::SYSTEM))); m_xEdComment->set_text(aComment); m_xEdName->set_text(rName); diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index a14b9070a041..b0e6c81f6243 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -183,7 +183,7 @@ bool ScAreaLink::IsEqual( const OUString& rFile, const OUString& rFilter, const bool ScAreaLink::FindExtRange( ScRange& rRange, const ScDocument* pSrcDoc, const OUString& rAreaName ) { bool bFound = false; - OUString aUpperName = ScGlobal::pCharClass->uppercase(rAreaName); + OUString aUpperName = ScGlobal::getCharClassPtr()->uppercase(rAreaName); ScRangeName* pNames = pSrcDoc->GetRangeName(); if (pNames) // named ranges { diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 59446bcec528..e57020b93de3 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -122,7 +122,7 @@ bool ScDBDocFunc::DeleteDBRange(const OUString& rName) bool bUndo = rDoc.IsUndoEnabled(); ScDBCollection::NamedDBs& rDBs = pDocColl->getNamedDBs(); - auto const iter = rDBs.findByUpperName2(ScGlobal::pCharClass->uppercase(rName)); + auto const iter = rDBs.findByUpperName2(ScGlobal::getCharClassPtr()->uppercase(rName)); if (iter != rDBs.end()) { ScDocShellModificator aModificator( rDocShell ); @@ -157,8 +157,8 @@ bool ScDBDocFunc::RenameDBRange( const OUString& rOld, const OUString& rNew ) ScDBCollection* pDocColl = rDoc.GetDBCollection(); bool bUndo = rDoc.IsUndoEnabled(); ScDBCollection::NamedDBs& rDBs = pDocColl->getNamedDBs(); - auto const iterOld = rDBs.findByUpperName2(ScGlobal::pCharClass->uppercase(rOld)); - const ScDBData* pNew = rDBs.findByUpperName(ScGlobal::pCharClass->uppercase(rNew)); + auto const iterOld = rDBs.findByUpperName2(ScGlobal::getCharClassPtr()->uppercase(rOld)); + const ScDBData* pNew = rDBs.findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rNew)); if (iterOld != rDBs.end() && !pNew) { ScDocShellModificator aModificator( rDocShell ); @@ -297,7 +297,7 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bApi, bool bIsUnnamed, { ScDBCollection* pColl = rDoc.GetDBCollection(); if (pColl) - pDBData = pColl->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rDBName)); + pDBData = pColl->getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rDBName)); } if ( pDBData ) @@ -1672,7 +1672,7 @@ void ScDBDocFunc::UpdateImport( const OUString& rTarget, const svx::ODataAccessD ScDocument& rDoc = rDocShell.GetDocument(); ScDBCollection& rDBColl = *rDoc.GetDBCollection(); - const ScDBData* pData = rDBColl.getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rTarget)); + const ScDBData* pData = rDBColl.getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rTarget)); if (!pData) { std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(ScDocShell::GetActiveDialogParent(), diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 733ba53d2f6d..d36c2f6f606e 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -5193,7 +5193,7 @@ void ScDocFunc::CreateOneName( ScRangeName& rList, OUString aContent(ScRange( nX1, nY1, nTab, nX2, nY2, nTab ).Format(rDoc, ScRefFlags::RANGE_ABS_3D)); bool bInsert = false; - ScRangeData* pOld = rList.findByUpperName(ScGlobal::pCharClass->uppercase(aName)); + ScRangeData* pOld = rList.findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName)); if (pOld) { OUString aOldStr; diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 6806ef37d962..8d9133f98735 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -638,8 +638,8 @@ void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, weld::Wind OUString aAuthor = pAction->GetUser(); DateTime aDT = pAction->GetDateTime(); - OUString aDate = ScGlobal::pLocaleData->getDate( aDT ) + " " + - ScGlobal::pLocaleData->getTime( aDT, false ); + OUString aDate = ScGlobal::getLocaleDataPtr()->getDate( aDT ) + " " + + ScGlobal::getLocaleDataPtr()->getTime( aDT, false ); SfxItemSet aSet( GetPool(), svl::Items<SID_ATTR_POSTIT_AUTHOR, SID_ATTR_POSTIT_TEXT>{}); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 0d7724a97b0a..d56594ed1895 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -259,7 +259,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) if (bIsNewArea) { ScDBCollection* pDBColl = m_aDocument.GetDBCollection(); - if ( !pDBColl || !pDBColl->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(sTarget)) ) + if ( !pDBColl || !pDBColl->getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(sTarget)) ) { ScAddress aPos; if ( aPos.Parse( sTarget, &m_aDocument, m_aDocument.GetAddressConvention() ) & ScRefFlags::VALID ) @@ -2349,7 +2349,7 @@ bool ScDocShell::DdeSetData( const OUString& rItem, ScRangeName* pRange = m_aDocument.GetRangeName(); if( pRange ) { - const ScRangeData* pData = pRange->findByUpperName(ScGlobal::pCharClass->uppercase(aPos)); + const ScRangeData* pData = pRange->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aPos)); if (pData) { if( pData->HasType( ScRangeData::Type::RefArea ) diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index c62350332204..0e29619f582b 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -303,7 +303,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe { ++nCount; aNewName = aImport + OUString::number( nCount ); - pDummy = rDBs.findByUpperName(ScGlobal::pCharClass->uppercase(aNewName)); + pDummy = rDBs.findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aNewName)); } while (pDummy); pNoNameData = new ScDBData( aNewName, nTab, diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index ad0e5b380d47..35b484a2110d 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -479,8 +479,8 @@ void ScDocShell::CheckConfigOptions() // no need to check repeatedly. return; - OUString aDecSep = ScGlobal::GetpLocaleData()->getNumDecimalSep(); - OUString aDecSepAlt = ScGlobal::GetpLocaleData()->getNumDecimalSepAlt(); + OUString aDecSep = ScGlobal::getLocaleDataPtr()->getNumDecimalSep(); + OUString aDecSepAlt = ScGlobal::getLocaleDataPtr()->getNumDecimalSepAlt(); ScModule* pScMod = SC_MOD(); const ScFormulaOptions& rOpt=pScMod->GetFormulaOptions(); diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 46aaa52e2099..38d449771318 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -84,7 +84,7 @@ class TabNameSearchPredicate { public: explicit TabNameSearchPredicate(const OUString& rSearchName) : - maSearchName(ScGlobal::pCharClass->uppercase(rSearchName)) + maSearchName(ScGlobal::getCharClassPtr()->uppercase(rSearchName)) { } @@ -498,7 +498,7 @@ const OUString* ScExternalRefCache::getRealRangeName(sal_uInt16 nFileId, const O const DocItem& rDoc = itrDoc->second; NamePairMap::const_iterator itr = rDoc.maRealRangeNameMap.find( - ScGlobal::pCharClass->uppercase(rRangeName)); + ScGlobal::getCharClassPtr()->uppercase(rRangeName)); if (itr == rDoc.maRealRangeNameMap.end()) // range name not found. return nullptr; @@ -717,7 +717,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getRangeNameTokens(sal_uIn RangeNameMap& rMap = pDoc->maRangeNames; RangeNameMap::const_iterator itr = rMap.find( - ScGlobal::pCharClass->uppercase(rName)); + ScGlobal::getCharClassPtr()->uppercase(rName)); if (itr == rMap.end()) return TokenArrayRef(); @@ -732,7 +732,7 @@ void ScExternalRefCache::setRangeNameTokens(sal_uInt16 nFileId, const OUString& if (!pDoc) return; - OUString aUpperName = ScGlobal::pCharClass->uppercase(rName); + OUString aUpperName = ScGlobal::getCharClassPtr()->uppercase(rName); RangeNameMap& rMap = pDoc->maRangeNames; rMap.emplace(aUpperName, pArray); pDoc->maRealRangeNameMap.emplace(aUpperName, rName); @@ -758,7 +758,7 @@ void ScExternalRefCache::setRangeName(sal_uInt16 nFileId, const OUString& rName) if (!pDoc) return; - OUString aUpperName = ScGlobal::pCharClass->uppercase(rName); + OUString aUpperName = ScGlobal::getCharClassPtr()->uppercase(rName); pDoc->maRealRangeNameMap.emplace(aUpperName, rName); } @@ -929,7 +929,7 @@ void ScExternalRefCache::initializeDoc(sal_uInt16 nFileId, const vector<OUString aNewTabNames.reserve(n); for (const auto& rTabName : rTabNames) { - TableName aNameItem(ScGlobal::pCharClass->uppercase(rTabName), rTabName); + TableName aNameItem(ScGlobal::getCharClassPtr()->uppercase(rTabName), rTabName); aNewTabNames.push_back(aNameItem); } pDoc->maTableNames.swap(aNewTabNames); @@ -974,7 +974,7 @@ void ScExternalRefCache::initializeDoc(sal_uInt16 nFileId, const vector<OUString ScExternalRefCache::TableNameIndexMap::const_iterator ScExternalRefCache::DocItem::findTableNameIndex( const OUString& rTabName ) const { - const OUString aTabNameUpper = ScGlobal::pCharClass->uppercase( rTabName); + const OUString aTabNameUpper = ScGlobal::getCharClassPtr()->uppercase( rTabName); TableNameIndexMap::const_iterator itrTabName = maTableNameIndex.find( aTabNameUpper); if (itrTabName != maTableNameIndex.end()) return itrTabName; @@ -988,7 +988,7 @@ ScExternalRefCache::TableNameIndexMap::const_iterator ScExternalRefCache::DocIte // maSingleTableNameAlias has been set up only if the original file loaded // had exactly one sheet and internal sheet name was Sheet1 or localized or // customized equivalent, or base name. - if (aTabNameUpper == ScGlobal::pCharClass->uppercase( maSingleTableNameAlias)) + if (aTabNameUpper == ScGlobal::getCharClassPtr()->uppercase( maSingleTableNameAlias)) return maTableNameIndex.begin(); return itrTabName; @@ -1350,7 +1350,7 @@ ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nF } // Specified table doesn't exist yet. Create one. - OUString aTabNameUpper = ScGlobal::pCharClass->uppercase(rTabName); + OUString aTabNameUpper = ScGlobal::getCharClassPtr()->uppercase(rTabName); nIndex = rDoc.maTables.size(); if( pnIndex ) *pnIndex = nIndex; TableTypeRef pTab = std::make_shared<Table>(); @@ -2065,7 +2065,7 @@ namespace { bool hasRangeName(const ScDocument& rDoc, const OUString& rName) { ScRangeName* pExtNames = rDoc.GetRangeName(); - OUString aUpperName = ScGlobal::pCharClass->uppercase(rName); + OUString aUpperName = ScGlobal::getCharClassPtr()->uppercase(rName); const ScRangeData* pRangeData = pExtNames->findByUpperName(aUpperName); return pRangeData != nullptr; } @@ -2261,7 +2261,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokensFromSr vector<ScExternalRefCache::SingleRangeData> aCacheData; aCacheData.reserve(nTabSpan+1); aCacheData.emplace_back(); - aCacheData.back().maTableName = ScGlobal::pCharClass->uppercase(rTabName); + aCacheData.back().maTableName = ScGlobal::getCharClassPtr()->uppercase(rTabName); for (SCTAB i = 1; i < nTabSpan + 1; ++i) { @@ -2271,7 +2271,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokensFromSr break; aCacheData.emplace_back(); - aCacheData.back().maTableName = ScGlobal::pCharClass->uppercase(aTabName); + aCacheData.back().maTableName = ScGlobal::getCharClassPtr()->uppercase(aTabName); } aRange.aStart.SetTab(nTab1); @@ -2287,7 +2287,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokensFromSr sal_uInt16 nFileId, const ScDocument* pSrcDoc, OUString& rName) { ScRangeName* pExtNames = pSrcDoc->GetRangeName(); - OUString aUpperName = ScGlobal::pCharClass->uppercase(rName); + OUString aUpperName = ScGlobal::getCharClassPtr()->uppercase(rName); const ScRangeData* pRangeData = pExtNames->findByUpperName(aUpperName); if (!pRangeData) return ScExternalRefCache::TokenArrayRef(); diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index bc362f89bd17..6b475eccba0e 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -169,7 +169,7 @@ ScImportExport::ScImportExport( ScDocument* p, const OUString& rPos ) ScRangeName* pRange = pDoc->GetRangeName(); if (pRange) { - const ScRangeData* pData = pRange->findByUpperName(ScGlobal::pCharClass->uppercase(aPos)); + const ScRangeData* pData = pRange->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aPos)); if (pData) { if( pData->HasType( ScRangeData::Type::RefArea ) @@ -1057,8 +1057,8 @@ static bool lcl_PutString( nPos <= nStart[nFound]+2 && rStr[nPos] == 'T') bInNum = false; // ISO-8601: YYYY-MM-DDThh:mm... else if ((((!bInNum && nFound==nMP) || (bInNum && nFound==nMP+1)) - && ScGlobal::pCharClass->isLetterNumeric( rStr, nPos)) - || ScGlobal::pCharClass->isDigit( rStr, nPos)) + && ScGlobal::getCharClassPtr()->isLetterNumeric( rStr, nPos)) + || ScGlobal::getCharClassPtr()->isDigit( rStr, nPos)) { if (!bInNum) { @@ -1080,7 +1080,7 @@ static bool lcl_PutString( sal_Int32 nDateLen = nEnd[0] + 1 - nDateStart; if ( nDateLen >= 5 && nDateLen <= 8 && - ScGlobal::pCharClass->isNumeric( rStr.copy( nDateStart, nDateLen ) ) ) + ScGlobal::getCharClassPtr()->isNumeric( rStr.copy( nDateStart, nDateLen ) ) ) { // 6 digits: 2 each for day, month, year // 8 digits: 4 for year, 2 each for day and month diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx index 3540a9c99931..29a780e89668 100644 --- a/sc/source/ui/docshell/servobj.cxx +++ b/sc/source/ui/docshell/servobj.cxx @@ -40,7 +40,7 @@ static bool lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const OU ScRangeName* pNames = rDoc.GetRangeName(); if (pNames) { - const ScRangeData* pData = pNames->findByUpperName(ScGlobal::pCharClass->uppercase(rName)); + const ScRangeData* pData = pNames->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rName)); if (pData) { if ( pData->IsValidReference( rRange ) ) diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index ba2edd3d554b..f9e70deb9e4c 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -424,9 +424,9 @@ std::unique_ptr<weld::TreeIter> ScAcceptChgDlg::AppendChangeAction( { aBuf.append(aUser); aBuf.append('\t'); - aBuf.append(ScGlobal::pLocaleData->getDate(aDateTime)); + aBuf.append(ScGlobal::getLocaleDataPtr()->getDate(aDateTime)); aBuf.append(' '); - aBuf.append(ScGlobal::pLocaleData->getTime(aDateTime)); + aBuf.append(ScGlobal::getLocaleDataPtr()->getTime(aDateTime)); aBuf.append('\t'); bIsGenerated = false; @@ -603,7 +603,7 @@ std::unique_ptr<weld::TreeIter> ScAcceptChgDlg::AppendFilteredAction( if (!bIsGenerated) { rTreeView.set_text(*xEntry, aUser, 2); - OUString sDate = ScGlobal::pLocaleData->getDate(aDateTime) + " " + ScGlobal::pLocaleData->getTime(aDateTime); + OUString sDate = ScGlobal::getLocaleDataPtr()->getDate(aDateTime) + " " + ScGlobal::getLocaleDataPtr()->getTime(aDateTime); rTreeView.set_text(*xEntry, sDate, 3); } @@ -691,8 +691,8 @@ std::unique_ptr<weld::TreeIter> ScAcceptChgDlg::InsertChangeActionContent(const if(!bIsGenerated) { aString += aUser + "\t" - + ScGlobal::pLocaleData->getDate(aDateTime) + " " - + ScGlobal::pLocaleData->getTime(aDateTime) + "\t"; + + ScGlobal::getLocaleDataPtr()->getDate(aDateTime) + " " + + ScGlobal::getLocaleDataPtr()->getTime(aDateTime) + "\t"; } else { diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index 44fa644df866..7a524e3f32e1 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -417,8 +417,8 @@ void ScConflictsDlg::SetActionString(const ScChangeAction* pAction, ScDocument* rTreeView.set_text(rEntry, aUser, 1); DateTime aDateTime = pAction->GetDateTime(); - OUString aString = ScGlobal::pLocaleData->getDate( aDateTime ) + " " + - ScGlobal::pLocaleData->getTime( aDateTime, false ); + OUString aString = ScGlobal::getLocaleDataPtr()->getDate( aDateTime ) + " " + + ScGlobal::getLocaleDataPtr()->getTime( aDateTime, false ); rTreeView.set_text(rEntry, aString, 2); } } diff --git a/sc/source/ui/miscdlgs/dataproviderdlg.cxx b/sc/source/ui/miscdlgs/dataproviderdlg.cxx index ab57613e2d82..7a3333a64640 100644 --- a/sc/source/ui/miscdlgs/dataproviderdlg.cxx +++ b/sc/source/ui/miscdlgs/dataproviderdlg.cxx @@ -895,7 +895,7 @@ namespace { bool hasDBName(const OUString& rName, ScDBCollection* pDBCollection) { - if (pDBCollection->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rName))) + if (pDBCollection->getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rName))) return true; return false; diff --git a/sc/source/ui/miscdlgs/redcom.cxx b/sc/source/ui/miscdlgs/redcom.cxx index 1da3d974a3b7..63b4332e2245 100644 --- a/sc/source/ui/miscdlgs/redcom.cxx +++ b/sc/source/ui/miscdlgs/redcom.cxx @@ -109,8 +109,8 @@ void ScRedComDialog::ReInit(ScChangeAction *pAction) OUString aAuthor = pChangeAction->GetUser(); DateTime aDT = pChangeAction->GetDateTime(); - OUString aDate = ScGlobal::pLocaleData->getDate( aDT ) + " " + - ScGlobal::pLocaleData->getTime( aDT, false ); + OUString aDate = ScGlobal::getLocaleDataPtr()->getDate( aDT ) + " " + + ScGlobal::getLocaleDataPtr()->getTime( aDT, false ); pDlg->ShowLastAuthor(aAuthor, aDate); pDlg->SetNote(aComment); diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx index 8e17ca55b073..432bc6234488 100644 --- a/sc/source/ui/miscdlgs/sharedocdlg.cxx +++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx @@ -37,7 +37,7 @@ using namespace ::com::sun::star; IMPL_LINK(ScShareDocumentDlg, SizeAllocated, const Size&, rSize, void) { - OUString sWidestAccessString = getWidestTime(*ScGlobal::pLocaleData); + OUString sWidestAccessString = getWidestTime(*ScGlobal::getLocaleDataPtr()); std::vector<int> aWidths; const int nAccessWidth = m_xLbUsers->get_pixel_size(sWidestAccessString).Width() * 2; aWidths.push_back(rSize.Width() - nAccessWidth); @@ -145,7 +145,7 @@ void ScShareDocumentDlg::UpdateView() tools::Time aTime( nHours, nMinutes ); DateTime aDateTime( aDate, aTime ); - OUString aString = formatTime(aDateTime, *ScGlobal::pLocaleData); + OUString aString = formatTime(aDateTime, *ScGlobal::getLocaleDataPtr()); m_xLbUsers->append_text(aUser); m_xLbUsers->set_text(m_xLbUsers->n_children() - 1, aString, 1); @@ -195,8 +195,8 @@ void ScShareDocumentDlg::UpdateView() util::DateTime uDT(xDocProps->getModificationDate()); DateTime aDateTime(uDT); - OUString aString = formatTime(aDateTime, *ScGlobal::pLocaleData) + " " + - ScGlobal::pLocaleData->getTime( aDateTime, false ); + OUString aString = formatTime(aDateTime, *ScGlobal::getLocaleDataPtr()) + " " + + ScGlobal::getLocaleDataPtr()->getTime( aDateTime, false ); m_xLbUsers->append_text(aUser); m_xLbUsers->set_text(m_xLbUsers->n_children() - 1, aString, 1); diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index 14914cdebc29..b336460734b6 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -211,7 +211,7 @@ void ScSolverOptionsDialog::FillListBox() OUString sTxt = aVisName + ": "; sTxt += rtl::math::doubleToUString(fDoubleValue, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - ScGlobal::GetpLocaleData()->getNumDecimalSep()[0], true ); + ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true ); m_xLbSettings->set_text(nPos, sTxt, 1); } @@ -259,7 +259,7 @@ void ScSolverOptionsDialog::EditOption() OUString sTxt(pStringItem->GetText() + ": "); sTxt += rtl::math::doubleToUString(pStringItem->GetDoubleValue(), rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - ScGlobal::GetpLocaleData()->getNumDecimalSep()[0], true ); + ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true ); m_xLbSettings->set_text(nEntry, sTxt, 1); } @@ -374,7 +374,7 @@ void ScSolverValueDialog::SetValue( double fValue ) { m_xEdValue->set_text( rtl::math::doubleToUString( fValue, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - ScGlobal::GetpLocaleData()->getNumDecimalSep()[0], true ) ); + ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true ) ); } double ScSolverValueDialog::GetValue() const @@ -383,7 +383,7 @@ double ScSolverValueDialog::GetValue() const rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok; sal_Int32 nParseEnd = 0; - double fValue = ScGlobal::GetpLocaleData()->stringToDouble( aInput, true, &eStatus, &nParseEnd); + double fValue = ScGlobal::getLocaleDataPtr()->stringToDouble( aInput, true, &eStatus, &nParseEnd); /* TODO: shouldn't there be some error checking? */ return fValue; } 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() diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 0e073beb92bc..1fbeddfcaa32 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -350,7 +350,7 @@ static OUString lcl_GetDBAreaRange( const ScDocument* pDoc, const OUString& rDBN if (pDoc) { ScDBCollection* pDbNames = pDoc->GetDBCollection(); - const ScDBData* pData = pDbNames->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rDBName)); + const ScDBData* pData = pDbNames->getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rDBName)); if (pData) { ScRange aRange; @@ -1186,7 +1186,7 @@ static bool lcl_GetRange( const ScDocument* pDoc, ScContentId nType, const OUStr ScRangeName* pList = pDoc->GetRangeName(); if (pList) { - const ScRangeData* p = pList->findByUpperName(ScGlobal::pCharClass->uppercase(rName)); + const ScRangeData* p = pList->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rName)); if (p && p->IsValidReference(rRange)) bFound = true; } @@ -1196,7 +1196,7 @@ static bool lcl_GetRange( const ScDocument* pDoc, ScContentId nType, const OUStr ScDBCollection* pList = pDoc->GetDBCollection(); if (pList) { - const ScDBData* p = pList->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rName)); + const ScDBData* p = pList->getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rName)); if (p) { SCTAB nTab; diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index 5bf50dea60b9..440a509f853d 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -71,7 +71,7 @@ ScTpFormulaOptions::ScTpFormulaOptions(weld::Container* pPage, weld::DialogContr mxEdSepArrayRow->connect_focus_in(aLink3); // Get the decimal separator for current locale. - OUString aSep = ScGlobal::GetpLocaleData()->getNumDecimalSep(); + OUString aSep = ScGlobal::getLocaleDataPtr()->getNumDecimalSep(); mnDecSep = aSep.isEmpty() ? u'.' : aSep[0]; maSavedDocOptions = static_cast<const ScTpCalcItem&>(rCoreAttrs.Get( diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index 34d9ffb32f52..373908540f7c 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -902,7 +902,7 @@ void ScUndoAutoFilter::DoChange( bool bUndo ) else { ScDBCollection* pColl = rDoc.GetDBCollection(); - pDBData = pColl->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(aDBName)); + pDBData = pColl->getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aDBName)); } if ( pDBData ) diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 596da506ad14..056b3c281a0c 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -1581,7 +1581,7 @@ ScDBData* ScDatabaseRangeObj::GetDBData_Impl() const ScDBCollection* pNames = pDocShell->GetDocument().GetDBCollection(); if (pNames) { - ScDBData* p = pNames->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(aName)); + ScDBData* p = pNames->getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName)); if (p) pRet = p; } @@ -2264,7 +2264,7 @@ sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const OUString& aName ) { ScDBCollection* pNames = pDocShell->GetDocument().GetDBCollection(); if (pNames) - return pNames->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(aName)) != nullptr; + return pNames->getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName)) != nullptr; } return false; } diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 1152389b1883..d6adc7611576 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -276,7 +276,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScFunctionAccess ) static bool lcl_AddFunctionToken( ScTokenArray& rArray, const OUString& rName,const ScCompiler& rCompiler ) { // function names are always case-insensitive - OUString aUpper = ScGlobal::pCharClass->uppercase(rName); + OUString aUpper = ScGlobal::getCharClassPtr()->uppercase(rName); // same options as in ScCompiler::IsOpCode: // 1. built-in function name diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index b3a3e65e57ed..de209a3e745d 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -122,7 +122,7 @@ ScRangeData* ScNamedRangeObj::GetRangeData_Impl() pNames = pDocShell->GetDocument().GetRangeName(); if (pNames) { - pRet = pNames->findByUpperName(ScGlobal::pCharClass->uppercase(aName)); + pRet = pNames->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName)); if (pRet) pRet->ValidateTabRefs(); // adjust relative tab refs to valid tables } @@ -166,7 +166,7 @@ void ScNamedRangeObj::Modify_Impl( const OUString* pNewName, const ScTokenArray* if (!pNames) return; - const ScRangeData* pOld = pNames->findByUpperName(ScGlobal::pCharClass->uppercase(aName)); + const ScRangeData* pOld = pNames->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName)); if (!pOld) return; @@ -488,7 +488,7 @@ void SAL_CALL ScNamedRangesObj::addNewByName( const OUString& aName, { ScDocument& rDoc = pDocShell->GetDocument(); ScRangeName* pNames = GetRangeName_Impl(); - if (pNames && !pNames->findByUpperName(ScGlobal::pCharClass->uppercase(aName))) + if (pNames && !pNames->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName))) { std::unique_ptr<ScRangeName> pNewRanges(new ScRangeName( *pNames )); // GRAM_API for API compatibility. @@ -543,7 +543,7 @@ void SAL_CALL ScNamedRangesObj::removeByName( const OUString& aName ) ScRangeName* pNames = GetRangeName_Impl(); if (pNames) { - const ScRangeData* pData = pNames->findByUpperName(ScGlobal::pCharClass->uppercase(aName)); + const ScRangeData* pData = pNames->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName)); if (pData && lcl_UserVisibleName(*pData)) { std::unique_ptr<ScRangeName> pNewRanges(new ScRangeName(*pNames)); @@ -685,7 +685,7 @@ sal_Bool SAL_CALL ScNamedRangesObj::hasByName( const OUString& aName ) ScRangeName* pNames = GetRangeName_Impl(); if (pNames) { - const ScRangeData* pData = pNames->findByUpperName(ScGlobal::pCharClass->uppercase(aName)); + const ScRangeData* pData = pNames->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName)); if (pData && lcl_UserVisibleName(*pData)) return true; } diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index df19cb0d8117..dc908cbaf354 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -1195,7 +1195,7 @@ bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, const if (pRangeName) { // TODO: Handle local names correctly: - // bool bLocalName = pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(sAddress)) != nullptr; + // bool bLocalName = pRangeName->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(sAddress)) != nullptr; } } char aChar = 0; diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 9095a7aa2c2d..3083cf0fd18a 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -910,7 +910,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) if (pDoc->GetFormatTable()->IsNumberFormat(aTemp1, nNumIndex, nVal)) aExpr1 = ::rtl::math::doubleToUString( nVal, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - ScGlobal::pLocaleData->getNumDecimalSep()[0], true); + ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true); else aExpr1 = aTemp1; } @@ -927,7 +927,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) if (pDoc->GetFormatTable()->IsNumberFormat(aTemp2, nNumIndex, nVal)) aExpr2 = ::rtl::math::doubleToUString( nVal, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - ScGlobal::pLocaleData->getNumDecimalSep()[0], true); + ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true); else aExpr2 = aTemp2; if ( eMode == SC_VALID_TIME ) { diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx index b0dd221a118b..9f248168fc5a 100644 --- a/sc/source/ui/view/colrowba.cxx +++ b/sc/source/ui/view/colrowba.cxx @@ -42,7 +42,7 @@ static OUString lcl_MetricString( long nTwips, const OUString& rText ) sal_Int64 nUserVal = vcl::ConvertValue( nTwips*100, 1, 2, FieldUnit::TWIP, eUserMet ); OUString aStr = rText + " " - + ScGlobal::pLocaleData->getNum( nUserVal, 2 ) + + ScGlobal::getLocaleDataPtr()->getNum( nUserVal, 2 ) + " " + SdrFormatter::GetUnitStr(eUserMet); return aStr; } diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx index c5fa578cade8..74d211d02683 100644 --- a/sc/source/ui/view/dbfunc.cxx +++ b/sc/source/ui/view/dbfunc.cxx @@ -54,7 +54,7 @@ void ScDBFunc::GotoDBArea( const OUString& rDBName ) { ScDocument* pDoc = GetViewData().GetDocument(); ScDBCollection* pDBCol = pDoc->GetDBCollection(); - ScDBData* pData = pDBCol->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rDBName)); + ScDBData* pData = pDBCol->getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rDBName)); if (pData) { SCTAB nTab = 0; diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx index b940ffe200b1..0d54b07471a4 100644 --- a/sc/source/ui/view/gridwin5.cxx +++ b/sc/source/ui/view/gridwin5.cxx @@ -129,9 +129,9 @@ bool ScGridWindow::ShowNoteMarker( SCCOL nPosX, SCROW nPosY, bool bKeyboard ) DateTime aDT = pFound->GetDateTime(); aTrackText = pFound->GetUser() + ", " - + ScGlobal::pLocaleData->getDate(aDT) + + ScGlobal::getLocaleDataPtr()->getDate(aDT) + " " - + ScGlobal::pLocaleData->getTime(aDT) + + ScGlobal::getLocaleDataPtr()->getTime(aDT) + ":\n"; OUString aComStr=pFound->GetComment(); if(!aComStr.isEmpty()) diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index c50c3c06df94..4286f2a36d43 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -637,7 +637,7 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScRefCellValue& rCell, long nWidth } sal_uInt8 nSignCount = 0, nDecimalCount = 0, nExpCount = 0; sal_Int32 nLen = aString.getLength(); - sal_Unicode cDecSep = ScGlobal::GetpLocaleData()->getLocaleItem().decimalSeparator[0]; + sal_Unicode cDecSep = ScGlobal::getLocaleDataPtr()->getLocaleItem().decimalSeparator[0]; for( sal_Int32 i = 0; i < nLen; ++i ) { sal_Unicode c = aString[i]; @@ -745,7 +745,7 @@ long ScDrawStringsVars::GetDotWidth() if (nDotWidth > 0) return nDotWidth; - const OUString& sep = ScGlobal::GetpLocaleData()->getLocaleItem().decimalSeparator; + const OUString& sep = ScGlobal::getLocaleDataPtr()->getLocaleItem().decimalSeparator; nDotWidth = pOutput->pFmtDevice->GetTextWidth(sep); return nDotWidth; } @@ -1369,7 +1369,7 @@ bool beginsWithRTLCharacter(const OUString& rStr) if (rStr.isEmpty()) return false; - switch (ScGlobal::pCharClass->getCharacterDirection(rStr, 0)) + switch (ScGlobal::getCharClassPtr()->getCharacterDirection(rStr, 0)) { case i18n::DirectionProperty_RIGHT_TO_LEFT: case i18n::DirectionProperty_RIGHT_TO_LEFT_ARABIC: diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 7d5e99686ca6..d70b2742b6f6 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -2864,7 +2864,7 @@ bool ScViewFunc::InsertName( const OUString& rName, const OUString& rSymbol, rDoc.PreprocessRangeNameUpdate(); // input available yet? Then remove beforehand (=change) - ScRangeData* pData = pList->findByUpperName(ScGlobal::pCharClass->uppercase(rName)); + ScRangeData* pData = pList->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rName)); if (pData) { // take old Index pNewEntry->SetIndex(pData->GetIndex()); |