[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Fri Sep 17 12:47:01 UTC 2021
sc/inc/global.hxx | 4 ++--
sc/source/core/data/documen2.cxx | 4 ++--
sc/source/core/data/dpcache.cxx | 2 +-
sc/source/core/data/dptabsrc.cxx | 4 ++--
sc/source/core/data/dputil.cxx | 6 +++---
sc/source/core/data/global.cxx | 8 ++++----
sc/source/core/data/globalx.cxx | 2 +-
sc/source/core/data/postit.cxx | 2 +-
sc/source/core/data/table3.cxx | 2 +-
sc/source/core/tool/compiler.cxx | 10 +++++-----
sc/source/core/tool/editutil.cxx | 6 +++---
sc/source/core/tool/formulaopt.cxx | 2 +-
sc/source/core/tool/numformat.cxx | 2 +-
sc/source/core/tool/optutil.cxx | 2 +-
sc/source/core/tool/userlist.cxx | 2 +-
sc/source/filter/excel/excimp8.cxx | 2 +-
sc/source/filter/html/htmlexp.cxx | 2 +-
sc/source/filter/xcl97/xcl97rec.cxx | 2 +-
sc/source/ui/app/inputhdl.cxx | 8 ++++----
sc/source/ui/cctrl/checklistmenu.cxx | 4 ++--
sc/source/ui/cctrl/editfield.cxx | 4 ++--
sc/source/ui/dbgui/scendlg.cxx | 4 ++--
sc/source/ui/docshell/docsh3.cxx | 4 ++--
sc/source/ui/docshell/docsh6.cxx | 4 ++--
sc/source/ui/miscdlgs/acredlin.cxx | 10 +++++-----
sc/source/ui/miscdlgs/conflictsdlg.cxx | 4 ++--
sc/source/ui/miscdlgs/redcom.cxx | 4 ++--
sc/source/ui/miscdlgs/sharedocdlg.cxx | 8 ++++----
sc/source/ui/miscdlgs/solveroptions.cxx | 8 ++++----
sc/source/ui/optdlg/tpformula.cxx | 2 +-
sc/source/ui/vba/vbarange.cxx | 4 ++--
sc/source/ui/view/cellsh2.cxx | 4 ++--
sc/source/ui/view/colrowba.cxx | 2 +-
sc/source/ui/view/gridwin5.cxx | 4 ++--
sc/source/ui/view/output2.cxx | 4 ++--
35 files changed, 73 insertions(+), 73 deletions(-)
New commits:
commit c67b9a4ce5ac3a09437730d8440c84159b581622
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Sep 17 09:43:00 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Sep 17 14:46:39 2021 +0200
rather return ref from GetCalendar
since we never return a nullptr
Change-Id: I4cb4af99752818e323472a372330d1bc2a3df4f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122236
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index a8c885f48155..6a3eab0d837d 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -538,7 +538,7 @@ public:
SC_DLLPUBLIC static const LocaleDataWrapper& getLocaleData();
SC_DLLPUBLIC static const CharClass& getCharClass();
- static CalendarWrapper* GetCalendar();
+ static CalendarWrapper& GetCalendar();
SC_DLLPUBLIC static CollatorWrapper* GetCollator();
static CollatorWrapper* GetCaseCollator();
static css::lang::Locale* GetLocale();
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index 1950c8500d39..24ef497b3424 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -2388,14 +2388,14 @@ ScDPMember* ScDPMembers::getByIndex(sal_Int32 nIndex) const
else if ( nHier == SC_DAPI_HIERARCHY_WEEK && nLev == SC_DAPI_LEVEL_WEEKDAY )
{
nVal = nIndex; // DayOfWeek is 0-based
- aName = ScGlobal::GetCalendar()->getDisplayName(
+ aName = ScGlobal::GetCalendar().getDisplayName(
css::i18n::CalendarDisplayIndex::DAY,
sal::static_int_cast<sal_Int16>(nVal), 0 );
}
else if ( nHier == SC_DAPI_HIERARCHY_QUARTER && nLev == SC_DAPI_LEVEL_MONTH )
{
nVal = nIndex; // Month is 0-based
- aName = ScGlobal::GetCalendar()->getDisplayName(
+ aName = ScGlobal::GetCalendar().getDisplayName(
css::i18n::CalendarDisplayIndex::MONTH,
sal::static_int_cast<sal_Int16>(nVal), 0 );
}
diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx
index 23f18b906485..b589d4e80156 100644
--- a/sc/source/core/data/dputil.cxx
+++ b/sc/source/core/data/dputil.cxx
@@ -116,7 +116,7 @@ OUString ScDPUtil::getDateGroupName(
case sheet::DataPilotFieldGroupBy::QUARTERS:
return ScGlobal::getLocaleData().getQuarterAbbreviation(sal_Int16(nValue-1)); // nValue is 1-based
case css::sheet::DataPilotFieldGroupBy::MONTHS:
- return ScGlobal::GetCalendar()->getDisplayName(
+ return ScGlobal::GetCalendar().getDisplayName(
i18n::CalendarDisplayIndex::MONTH, sal_Int16(nValue-1), 0); // 0-based, get short name
case sheet::DataPilotFieldGroupBy::DAYS:
{
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 38ab85a91df9..be6711849c02 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -1018,7 +1018,7 @@ const CharClass& ScGlobal::getCharClass()
return oSysLocale->GetCharClass();
}
-CalendarWrapper* ScGlobal::GetCalendar()
+CalendarWrapper& ScGlobal::GetCalendar()
{
assert(!bThreadedGroupCalcInProgress);
if ( !oCalendar )
@@ -1026,7 +1026,7 @@ CalendarWrapper* ScGlobal::GetCalendar()
oCalendar.emplace( ::comphelper::getProcessComponentContext() );
oCalendar->loadDefaultCalendar( *GetLocale() );
}
- return &*oCalendar;
+ return *oCalendar;
}
namespace {
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index d092a5f60848..32c62ff367e8 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -925,8 +925,8 @@ void ScCheckListMenuControl::addDateMember(const OUString& rsName, double nVal,
sal_uInt16 nDay = aDate.GetDay();
// Get the localized month name list.
- CalendarWrapper* pCalendar = ScGlobal::GetCalendar();
- uno::Sequence<i18n::CalendarItem2> aMonths = pCalendar->getMonths();
+ CalendarWrapper& rCalendar = ScGlobal::GetCalendar();
+ uno::Sequence<i18n::CalendarItem2> aMonths = rCalendar.getMonths();
if (aMonths.getLength() < nMonth)
return;
commit c8226655a8d838d15af7de3ba1fa5c47546b6ada
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Sep 17 08:54:02 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Sep 17 14:46:24 2021 +0200
rather return ref from getLocaleDataPtr
since we never return a nullptr, and rename to reflect that
Change-Id: I694b5198f663842d1362504d60e7191e450a08ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122224
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 7cf4d84b402f..a8c885f48155 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -535,7 +535,7 @@ class ScGlobal
public:
static std::optional<SvtSysLocale> oSysLocale;
- SC_DLLPUBLIC static const LocaleDataWrapper* getLocaleDataPtr();
+ SC_DLLPUBLIC static const LocaleDataWrapper& getLocaleData();
SC_DLLPUBLIC static const CharClass& getCharClass();
static CalendarWrapper* GetCalendar();
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 281b5e975982..8f77cb70ac46 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -1336,9 +1336,9 @@ void ScDocument::GetCellChangeTrackNote( const ScAddress &aCellPos, OUString &aT
DateTime aDT = pFound->GetDateTime();
aTrackText = pFound->GetUser();
aTrackText += ", ";
- aTrackText += ScGlobal::getLocaleDataPtr()->getDate(aDT);
+ aTrackText += ScGlobal::getLocaleData().getDate(aDT);
aTrackText += " ";
- aTrackText += ScGlobal::getLocaleDataPtr()->getTime(aDT);
+ aTrackText += ScGlobal::getLocaleData().getTime(aDT);
aTrackText += ":\n";
OUString aComStr = pFound->GetComment();
if(!aComStr.isEmpty())
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 2900dd318e77..7054fef3ba14 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -1248,7 +1248,7 @@ OUString ScDPCache::GetFormattedString(tools::Long nDim, const ScDPItemData& rIt
if (!p)
return rItem.GetString();
- sal_Unicode cDecSep = ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0];
+ sal_Unicode cDecSep = ScGlobal::getLocaleData().getNumDecimalSep()[0];
return ScDPUtil::getNumGroupName(fVal, p->maInfo, cDecSep, mrDoc.GetFormatTable());
}
diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx
index 3fdb43eddf9b..23f18b906485 100644
--- a/sc/source/core/data/dputil.cxx
+++ b/sc/source/core/data/dputil.cxx
@@ -114,7 +114,7 @@ OUString ScDPUtil::getDateGroupName(
case sheet::DataPilotFieldGroupBy::YEARS:
return OUString::number(nValue);
case sheet::DataPilotFieldGroupBy::QUARTERS:
- return ScGlobal::getLocaleDataPtr()->getQuarterAbbreviation(sal_Int16(nValue-1)); // nValue is 1-based
+ return ScGlobal::getLocaleData().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
@@ -139,7 +139,7 @@ OUString ScDPUtil::getDateGroupName(
case sheet::DataPilotFieldGroupBy::MINUTES:
case sheet::DataPilotFieldGroupBy::SECONDS:
{
- OUStringBuffer aBuf(ScGlobal::getLocaleDataPtr()->getTimeSep());
+ OUStringBuffer aBuf(ScGlobal::getLocaleData().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 81da6d470fef..38ab85a91df9 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -1000,13 +1000,13 @@ utl::TransliterationWrapper* ScGlobal::GetpTransliteration()
});
}
-const LocaleDataWrapper* ScGlobal::getLocaleDataPtr()
+const LocaleDataWrapper& ScGlobal::getLocaleData()
{
OSL_ENSURE(
oSysLocale,
"ScGlobal::getLocaleDataPtr() called before ScGlobal::Init()");
- return &oSysLocale->GetLocaleData();
+ return oSysLocale->GetLocaleData();
}
const CharClass& ScGlobal::getCharClass()
diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx
index 554d59d7adab..f08869cb1cb0 100644
--- a/sc/source/core/data/globalx.cxx
+++ b/sc/source/core/data/globalx.cxx
@@ -126,7 +126,7 @@ OUString ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber)
xOrdinalSuffix = i18n::OrdinalSuffix::create( ::comphelper::getProcessComponentContext() );
}
uno::Sequence< OUString > aSuffixes = xOrdinalSuffix->getOrdinalSuffix( nNumber,
- ScGlobal::getLocaleDataPtr()->getLanguageTag().getLocale());
+ ScGlobal::getLocaleData().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 096ab00cfca5..42649cccf66f 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -892,7 +892,7 @@ void ScPostIt::SetAuthor( const OUString& rAuthor )
void ScPostIt::AutoStamp()
{
- maNoteData.maDate = ScGlobal::getLocaleDataPtr()->getDate( Date( Date::SYSTEM ) );
+ maNoteData.maDate = ScGlobal::getLocaleData().getDate( Date( Date::SYSTEM ) );
maNoteData.maAuthor = SvtUserOptions().GetID();
}
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 4bfc8f2665b8..852e4a36f2f0 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -124,7 +124,7 @@ static bool SplitString( const OUString &sWhole,
return false;
// Get numeral element
- const OUString& sUser = ScGlobal::getLocaleDataPtr()->getNumDecimalSep();
+ const OUString& sUser = ScGlobal::getLocaleData().getNumDecimalSep();
ParseResult aPRNum = ScGlobal::getCharClass().parsePredefinedToken(
KParseType::ANY_NUMBER, sWhole, nPos,
KParseTokens::ANY_NUMBER, "", KParseTokens::ANY_NUMBER, sUser );
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index d2627be3dfdf..311993e6ff88 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2136,8 +2136,8 @@ std::vector<ScCompiler::Whitespace> 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::getLocaleDataPtr()->getNumDecimalSep()[0]);
- sal_Unicode cDecSepAlt = (mxSymbols->isEnglish() ? 0 : ScGlobal::getLocaleDataPtr()->getNumDecimalSepAlt().toChar());
+ sal_Unicode cDecSep = (mxSymbols->isEnglish() ? '.' : ScGlobal::getLocaleData().getNumDecimalSep()[0]);
+ sal_Unicode cDecSepAlt = (mxSymbols->isEnglish() ? 0 : ScGlobal::getLocaleData().getNumDecimalSepAlt().toChar());
// special symbols specific to address convention used
sal_Unicode cSheetPrefix = pConv->getSpecialSymbol(ScCompiler::Convention::ABS_SHEET_PREFIX);
@@ -2780,7 +2780,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::getLocaleDataPtr()->getNumThousandSep()[0];
+ const sal_Unicode cGroupSep = ScGlobal::getLocaleData().getNumThousandSep()[0];
const bool bGroupSeparator = (128 <= cGroupSep && cGroupSep != cSep &&
cGroupSep != cArrayColSep && cGroupSep != cArrayRowSep &&
cGroupSep != cDecSep && cGroupSep != cDecSepAlt &&
@@ -3395,14 +3395,14 @@ bool ScCompiler::IsReference( const OUString& rName, const OUString* pErrRef )
mnCurrentSheetTab = -1;
sal_Unicode ch1 = rName[0];
- sal_Unicode cDecSep = ( mxSymbols->isEnglish() ? '.' : ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0] );
+ sal_Unicode cDecSep = ( mxSymbols->isEnglish() ? '.' : ScGlobal::getLocaleData().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::getLocaleDataPtr()->getNumDecimalSepAlt().toChar();
+ cDecSep = ScGlobal::getLocaleData().getNumDecimalSepAlt().toChar();
if ( ch1 == cDecSep )
return false;
}
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index c025b1a8d98f..5262fa812e52 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -240,7 +240,7 @@ OUString ScEditUtil::GetCellFieldValue(
case text::textfield::Type::DATE:
{
Date aDate(Date::SYSTEM);
- aRet = ScGlobal::getLocaleDataPtr()->getDate(aDate);
+ aRet = ScGlobal::getLocaleData().getDate(aDate);
}
break;
case text::textfield::Type::DOCINFO_TITLE:
@@ -855,7 +855,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::getLocaleDataPtr()->getTime(aData.aDateTime);
+ aRet = ScGlobal::getLocaleData().getTime(aData.aDateTime);
break;
case text::textfield::Type::DOCINFO_TITLE:
aRet = aData.aTitle;
@@ -876,7 +876,7 @@ OUString ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField,
aRet = aData.aTabName;
break;
case text::textfield::Type::DATE:
- aRet = ScGlobal::getLocaleDataPtr()->getDate(aData.aDateTime);
+ aRet = ScGlobal::getLocaleData().getDate(aData.aDateTime);
break;
default:
aRet = "?";
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index d72e8e7db906..63362984164e 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -61,7 +61,7 @@ void ScFormulaOptions::GetDefaultFormulaSeparators(
// the old separator set.
return;
- const LocaleDataWrapper& rLocaleData = *ScGlobal::getLocaleDataPtr();
+ const LocaleDataWrapper& rLocaleData = ScGlobal::getLocaleData();
const OUString& rDecSep = rLocaleData.getNumDecimalSep();
const OUString& rListSep = rLocaleData.getListSep();
diff --git a/sc/source/core/tool/numformat.cxx b/sc/source/core/tool/numformat.cxx
index 88890800da8a..2482b49b0638 100644
--- a/sc/source/core/tool/numformat.cxx
+++ b/sc/source/core/tool/numformat.cxx
@@ -49,7 +49,7 @@ bool NumFmtUtil::isLatinScript( sal_uLong nFormat, ScDocument& rDoc )
OUString aDecSep;
LanguageType nFormatLang = pFormat->GetLanguage();
if (nFormatLang == LANGUAGE_SYSTEM)
- aDecSep = ScGlobal::getLocaleDataPtr()->getNumDecimalSep();
+ aDecSep = ScGlobal::getLocaleData().getNumDecimalSep();
else
{
LocaleDataWrapper aLocaleData(
diff --git a/sc/source/core/tool/optutil.cxx b/sc/source/core/tool/optutil.cxx
index 71ae002b6d95..2d32b9814e5d 100644
--- a/sc/source/core/tool/optutil.cxx
+++ b/sc/source/core/tool/optutil.cxx
@@ -29,7 +29,7 @@ bool ScOptionsUtil::IsMetricSystem()
//TODO: which language should be used here - system language or installed office language?
- MeasurementSystem eSys = ScGlobal::getLocaleDataPtr()->getMeasurementSystemEnum();
+ MeasurementSystem eSys = ScGlobal::getLocaleData().getMeasurementSystemEnum();
return ( eSys == MeasurementSystem::Metric );
}
diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx
index 5887a7257cb9..fb9dc97e6236 100644
--- a/sc/source/core/tool/userlist.cxx
+++ b/sc/source/core/tool/userlist.cxx
@@ -205,7 +205,7 @@ ScUserList::ScUserList()
uno::Sequence< i18n::CalendarItem2 > xCal;
const uno::Sequence< i18n::Calendar2 > xCalendars(
- ScGlobal::getLocaleDataPtr()->getAllCalendars() );
+ ScGlobal::getLocaleData().getAllCalendars() );
for ( const auto& rCalendar : xCalendars )
{
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index d2c58f3d234d..930057c7f789 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -483,7 +483,7 @@ OUString CreateFromDouble( double fVal )
{
return rtl::math::doubleToUString(fVal,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true);
+ ScGlobal::getLocaleData().getNumDecimalSep()[0], true);
}
}
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index e6447ee1a863..7e23a73b3b16 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -331,7 +331,7 @@ void ScHTMLExport::WriteHeader()
OUT_COMMENT( GLOBSTR( STR_DOC_INFO ) );
OUString aStrOut = GLOBSTR( STR_DOC_PRINTED ) + ": ";
lcl_AddStamp( aStrOut, xDocProps->getPrintedBy(),
- xDocProps->getPrintDate(), *ScGlobal::getLocaleDataPtr() );
+ xDocProps->getPrintDate(), ScGlobal::getLocaleData() );
OUT_COMMENT( aStrOut );
}
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 3d8f1e595473..38c0cbf7be94 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1512,7 +1512,7 @@ ExcEScenario::ExcEScenario( const XclExpRoot& rRoot, SCTAB nTab )
sText = ::rtl::math::doubleToUString( fVal,
rtl_math_StringFormat_Automatic,
rtl_math_DecimalPlaces_Max,
- ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0],
+ ScGlobal::getLocaleData().getNumDecimalSep()[0],
true );
}
else
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 4c052ab7b1fa..c55c97dac444 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3220,25 +3220,25 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
bInsertPreCorrectedString = false;
OUString aReplace(pAuto->GetStartDoubleQuote());
if( aReplace.isEmpty() )
- aReplace = ScGlobal::getLocaleDataPtr()->getDoubleQuotationMarkStart();
+ aReplace = ScGlobal::getLocaleData().getDoubleQuotationMarkStart();
if( aReplace != "\"" )
aString = aString.replaceAll( aReplace, "\"" );
aReplace = OUString(pAuto->GetEndDoubleQuote());
if( aReplace.isEmpty() )
- aReplace = ScGlobal::getLocaleDataPtr()->getDoubleQuotationMarkEnd();
+ aReplace = ScGlobal::getLocaleData().getDoubleQuotationMarkEnd();
if( aReplace != "\"" )
aString = aString.replaceAll( aReplace, "\"" );
aReplace = OUString(pAuto->GetStartSingleQuote());
if( aReplace.isEmpty() )
- aReplace = ScGlobal::getLocaleDataPtr()->getQuotationMarkStart();
+ aReplace = ScGlobal::getLocaleData().getQuotationMarkStart();
if( aReplace != "'" )
aString = aString.replaceAll( aReplace, "'" );
aReplace = OUString(pAuto->GetEndSingleQuote());
if( aReplace.isEmpty() )
- aReplace = ScGlobal::getLocaleDataPtr()->getQuotationMarkEnd();
+ aReplace = ScGlobal::getLocaleData().getQuotationMarkEnd();
if( aReplace != "'" )
aString = aString.replaceAll( aReplace, "'");
}
diff --git a/sc/source/ui/cctrl/editfield.cxx b/sc/source/ui/cctrl/editfield.cxx
index 28772daaf119..fd9d1e6b0be7 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::getLocaleDataPtr()->getNumDecimalSep()[0];
+ return ScGlobal::getLocaleData().getNumDecimalSep()[0];
}
} // namespace
@@ -48,7 +48,7 @@ bool ScDoubleField::GetValue( double& rfValue ) const
{
rtl_math_ConversionStatus eStatus;
sal_Int32 nEnd;
- rfValue = ScGlobal::getLocaleDataPtr()->stringToDouble( aStr, true, &eStatus, &nEnd );
+ rfValue = ScGlobal::getLocaleData().stringToDouble( aStr, true, &eStatus, &nEnd );
bOk = (eStatus == rtl_math_ConversionStatus_Ok) && (nEnd == aStr.getLength() );
}
return bOk;
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index f287bf1c440c..543914e14660 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::getLocaleDataPtr()->getDate(Date(Date::SYSTEM))
- + ", " + ScGlobal::getLocaleDataPtr()->getTime(tools::Time(tools::Time::SYSTEM)));
+ + ", " + sOn + " " + ScGlobal::getLocaleData().getDate(Date(Date::SYSTEM))
+ + ", " + ScGlobal::getLocaleData().getTime(tools::Time(tools::Time::SYSTEM)));
m_xEdComment->set_text(aComment);
m_xEdName->set_text(rName);
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 8120aba0662f..103b910803c9 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -643,8 +643,8 @@ void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, weld::Wind
OUString aAuthor = pAction->GetUser();
DateTime aDT = pAction->GetDateTime();
- OUString aDate = ScGlobal::getLocaleDataPtr()->getDate( aDT ) + " " +
- ScGlobal::getLocaleDataPtr()->getTime( aDT, false );
+ OUString aDate = ScGlobal::getLocaleData().getDate( aDT ) + " " +
+ ScGlobal::getLocaleData().getTime( aDT, false );
SfxItemSet aSet(
GetPool(), svl::Items<SID_ATTR_POSTIT_AUTHOR, SID_ATTR_POSTIT_TEXT>);
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index eb86c98e9a00..8b84ae64da34 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -476,8 +476,8 @@ void ScDocShell::CheckConfigOptions()
// no need to check repeatedly.
return;
- OUString aDecSep = ScGlobal::getLocaleDataPtr()->getNumDecimalSep();
- OUString aDecSepAlt = ScGlobal::getLocaleDataPtr()->getNumDecimalSepAlt();
+ OUString aDecSep = ScGlobal::getLocaleData().getNumDecimalSep();
+ OUString aDecSepAlt = ScGlobal::getLocaleData().getNumDecimalSepAlt();
ScModule* pScMod = SC_MOD();
const ScFormulaOptions& rOpt=pScMod->GetFormulaOptions();
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 051999a104e2..9cdc8a14cd81 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -430,9 +430,9 @@ std::unique_ptr<weld::TreeIter> ScAcceptChgDlg::AppendChangeAction(
{
aBuf.append(aUser);
aBuf.append('\t');
- aBuf.append(ScGlobal::getLocaleDataPtr()->getDate(aDateTime));
+ aBuf.append(ScGlobal::getLocaleData().getDate(aDateTime));
aBuf.append(' ');
- aBuf.append(ScGlobal::getLocaleDataPtr()->getTime(aDateTime));
+ aBuf.append(ScGlobal::getLocaleData().getTime(aDateTime));
aBuf.append('\t');
bIsGenerated = false;
@@ -609,7 +609,7 @@ std::unique_ptr<weld::TreeIter> ScAcceptChgDlg::AppendFilteredAction(
if (!bIsGenerated)
{
rTreeView.set_text(*xEntry, aUser, 2);
- OUString sDate = ScGlobal::getLocaleDataPtr()->getDate(aDateTime) + " " + ScGlobal::getLocaleDataPtr()->getTime(aDateTime);
+ OUString sDate = ScGlobal::getLocaleData().getDate(aDateTime) + " " + ScGlobal::getLocaleData().getTime(aDateTime);
rTreeView.set_text(*xEntry, sDate, 3);
}
@@ -697,8 +697,8 @@ std::unique_ptr<weld::TreeIter> ScAcceptChgDlg::InsertChangeActionContent(const
if(!bIsGenerated)
{
aString += aUser + "\t"
- + ScGlobal::getLocaleDataPtr()->getDate(aDateTime) + " "
- + ScGlobal::getLocaleDataPtr()->getTime(aDateTime) + "\t";
+ + ScGlobal::getLocaleData().getDate(aDateTime) + " "
+ + ScGlobal::getLocaleData().getTime(aDateTime) + "\t";
}
else
{
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index d1be90274f5f..69c2979efe53 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -419,8 +419,8 @@ void ScConflictsDlg::SetActionString(const ScChangeAction* pAction, ScDocument*
rTreeView.set_text(rEntry, aUser, 1);
DateTime aDateTime = pAction->GetDateTime();
- OUString aString = ScGlobal::getLocaleDataPtr()->getDate( aDateTime ) + " " +
- ScGlobal::getLocaleDataPtr()->getTime( aDateTime, false );
+ OUString aString = ScGlobal::getLocaleData().getDate( aDateTime ) + " " +
+ ScGlobal::getLocaleData().getTime( aDateTime, false );
rTreeView.set_text(rEntry, aString, 2);
}
diff --git a/sc/source/ui/miscdlgs/redcom.cxx b/sc/source/ui/miscdlgs/redcom.cxx
index 6af353bb8ef4..6eeb00fb0739 100644
--- a/sc/source/ui/miscdlgs/redcom.cxx
+++ b/sc/source/ui/miscdlgs/redcom.cxx
@@ -110,8 +110,8 @@ void ScRedComDialog::ReInit(ScChangeAction *pAction)
OUString aAuthor = pChangeAction->GetUser();
DateTime aDT = pChangeAction->GetDateTime();
- OUString aDate = ScGlobal::getLocaleDataPtr()->getDate( aDT ) + " " +
- ScGlobal::getLocaleDataPtr()->getTime( aDT, false );
+ OUString aDate = ScGlobal::getLocaleData().getDate( aDT ) + " " +
+ ScGlobal::getLocaleData().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 eb7c1f5c6e57..9910db9e47e5 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -38,7 +38,7 @@ using namespace ::com::sun::star;
IMPL_LINK(ScShareDocumentDlg, SizeAllocated, const Size&, rSize, void)
{
- OUString sWidestAccessString = getWidestTime(*ScGlobal::getLocaleDataPtr());
+ OUString sWidestAccessString = getWidestTime(ScGlobal::getLocaleData());
std::vector<int> aWidths;
const int nAccessWidth = m_xLbUsers->get_pixel_size(sWidestAccessString).Width() * 2;
aWidths.push_back(rSize.Width() - nAccessWidth);
@@ -146,7 +146,7 @@ void ScShareDocumentDlg::UpdateView()
tools::Time aTime( nHours, nMinutes );
DateTime aDateTime( aDate, aTime );
- OUString aString = formatTime(aDateTime, *ScGlobal::getLocaleDataPtr());
+ OUString aString = formatTime(aDateTime, ScGlobal::getLocaleData());
m_xLbUsers->append_text(aUser);
m_xLbUsers->set_text(m_xLbUsers->n_children() - 1, aString, 1);
@@ -196,8 +196,8 @@ void ScShareDocumentDlg::UpdateView()
util::DateTime uDT(xDocProps->getModificationDate());
DateTime aDateTime(uDT);
- OUString aString = formatTime(aDateTime, *ScGlobal::getLocaleDataPtr()) + " " +
- ScGlobal::getLocaleDataPtr()->getTime( aDateTime, false );
+ OUString aString = formatTime(aDateTime, ScGlobal::getLocaleData()) + " " +
+ ScGlobal::getLocaleData().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 b82654b5f5d5..b449d741eeb8 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -209,7 +209,7 @@ void ScSolverOptionsDialog::FillListBox()
OUString sTxt = aVisName + ": ";
sTxt += rtl::math::doubleToUString(fDoubleValue,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true );
+ ScGlobal::getLocaleData().getNumDecimalSep()[0], true );
m_xLbSettings->set_text(nPos, sTxt, 0);
}
@@ -265,7 +265,7 @@ void ScSolverOptionsDialog::EditOption()
OUString sTxt(pStringItem->GetText() + ": ");
sTxt += rtl::math::doubleToUString(pStringItem->GetDoubleValue(),
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true );
+ ScGlobal::getLocaleData().getNumDecimalSep()[0], true );
m_xLbSettings->set_text(nEntry, sTxt, 0);
}
@@ -390,7 +390,7 @@ void ScSolverValueDialog::SetValue( double fValue )
{
m_xEdValue->set_text( rtl::math::doubleToUString( fValue,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true ) );
+ ScGlobal::getLocaleData().getNumDecimalSep()[0], true ) );
}
void ScSolverValueDialog::SetMax(double fMax)
@@ -404,7 +404,7 @@ double ScSolverValueDialog::GetValue() const
rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
sal_Int32 nParseEnd = 0;
- double fValue = ScGlobal::getLocaleDataPtr()->stringToDouble( aInput, true, &eStatus, &nParseEnd);
+ double fValue = ScGlobal::getLocaleData().stringToDouble( aInput, true, &eStatus, &nParseEnd);
/* TODO: shouldn't there be some error checking? */
if (!std::isnan(m_fMaxValue) && fValue > m_fMaxValue)
fValue = m_fMaxValue;
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index c7d29e03dbc6..10a4b407c796 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -73,7 +73,7 @@ ScTpFormulaOptions::ScTpFormulaOptions(weld::Container* pPage, weld::DialogContr
mxEdSepArrayRow->connect_focus_in(aLink3);
// Get the decimal separator for current locale.
- OUString aSep = ScGlobal::getLocaleDataPtr()->getNumDecimalSep();
+ OUString aSep = ScGlobal::getLocaleData().getNumDecimalSep();
mnDecSep = aSep.isEmpty() ? u'.' : aSep[0];
maSavedDocOptions = static_cast<const ScTpCalcItem&>(rCoreAttrs.Get(
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index be5b87ddcdac..e2bb00124bc0 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -4386,13 +4386,13 @@ static void lcl_setTableFieldsFromCriteria( OUString& sCriteria1, const uno::Ref
// or, if the decimal separator is different from the English locale, without any locale.
sal_Int32 nParseEnd = 0;
rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
- double fValue = ScGlobal::getLocaleDataPtr()->stringToDouble( sCriteria1, false, &eStatus, &nParseEnd );
+ double fValue = ScGlobal::getLocaleData().stringToDouble( sCriteria1, false, &eStatus, &nParseEnd );
if ( nParseEnd == sCriteria1.getLength() && eStatus == rtl_math_ConversionStatus_Ok )
{
rFilterField.IsNumeric = true;
rFilterField.NumericValue = fValue;
}
- else if ( ScGlobal::getLocaleDataPtr()->getNumDecimalSep().toChar() != '.' )
+ else if ( ScGlobal::getLocaleData().getNumDecimalSep().toChar() != '.' )
{
eStatus = rtl_math_ConversionStatus_Ok;
fValue = ::rtl::math::stringToDouble( sCriteria1, '.', 0, &eStatus, &nParseEnd );
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 4d4c3b728fa0..08526a2fa34f 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -872,7 +872,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if (rDoc.GetFormatTable()->IsNumberFormat(aTemp1, nNumIndex, nVal))
aExpr1 = ::rtl::math::doubleToUString( nVal,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true);
+ ScGlobal::getLocaleData().getNumDecimalSep()[0], true);
else
aExpr1 = aTemp1;
}
@@ -889,7 +889,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if (rDoc.GetFormatTable()->IsNumberFormat(aTemp2, nNumIndex, nVal))
aExpr2 = ::rtl::math::doubleToUString( nVal,
rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0], true);
+ ScGlobal::getLocaleData().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 c380b0ff168b..ab9e82282e12 100644
--- a/sc/source/ui/view/colrowba.cxx
+++ b/sc/source/ui/view/colrowba.cxx
@@ -46,7 +46,7 @@ static OUString lcl_MetricString( tools::Long nTwips, std::u16string_view rText
sal_Int64 nUserVal = vcl::ConvertValue( nTwips*100, 1, 2, FieldUnit::TWIP, eUserMet );
OUString aStr = OUString::Concat(rText) + " "
- + ScGlobal::getLocaleDataPtr()->getNum( nUserVal, 2 )
+ + ScGlobal::getLocaleData().getNum( nUserVal, 2 )
+ " " + SdrFormatter::GetUnitStr(eUserMet);
return aStr;
}
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 96bd21856009..333c15197d91 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::getLocaleDataPtr()->getDate(aDT)
+ + ScGlobal::getLocaleData().getDate(aDT)
+ " "
- + ScGlobal::getLocaleDataPtr()->getTime(aDT)
+ + ScGlobal::getLocaleData().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 e2dd92f10e47..c1ac4fa31242 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -650,7 +650,7 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScRefCellValue& rCell, tools::Long
}
sal_uInt8 nSignCount = 0, nDecimalCount = 0, nExpCount = 0;
sal_Int32 nLen = aString.getLength();
- sal_Unicode cDecSep = ScGlobal::getLocaleDataPtr()->getLocaleItem().decimalSeparator[0];
+ sal_Unicode cDecSep = ScGlobal::getLocaleData().getLocaleItem().decimalSeparator[0];
for( sal_Int32 i = 0; i < nLen; ++i )
{
sal_Unicode c = aString[i];
@@ -759,7 +759,7 @@ tools::Long ScDrawStringsVars::GetDotWidth()
if (nDotWidth > 0)
return nDotWidth;
- const OUString& sep = ScGlobal::getLocaleDataPtr()->getLocaleItem().decimalSeparator;
+ const OUString& sep = ScGlobal::getLocaleData().getLocaleItem().decimalSeparator;
nDotWidth = pOutput->pFmtDevice->GetTextWidth(sep);
return nDotWidth;
}
More information about the Libreoffice-commits
mailing list