diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-04-11 19:35:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-04-12 15:14:15 +0200 |
commit | d4a9dae1eb6bbafa1c08939fc50eb3dd85cd7803 (patch) | |
tree | 3fd7a80091f327da782376805764b5a07d269bcd /svl | |
parent | 73ba7a4738ecaa730d4d41439b3a4a6d7693efa3 (diff) |
crashtesting: assert seen on importing forum-mso-en4-62805.xlsx
Change-Id: I1d1ab4539775c8c2fce591ca32fc15c3c0dd6060
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166024
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 8 | ||||
-rw-r--r-- | svl/source/numbers/zforfind.hxx | 2 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 370 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 190 |
4 files changed, 285 insertions, 285 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 350129da68d7..3d7333f3a1c6 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -129,7 +129,7 @@ void ImpSvNumberInputScan::Reset() } // native number transliteration if necessary -static void TransformInput(const NativeNumberWrapper* pNatNum, const SvNFLanguageData& rCurrentLanguage, OUString& rStr) +static void TransformInput(const NativeNumberWrapper& rNatNum, const SvNFLanguageData& rCurrentLanguage, OUString& rStr) { sal_Int32 nPos, nLen; for ( nPos = 0, nLen = rStr.getLength(); nPos < nLen; ++nPos ) @@ -142,7 +142,7 @@ static void TransformInput(const NativeNumberWrapper* pNatNum, const SvNFLanguag } if ( nPos < nLen ) { - rStr = pNatNum->getNativeNumberString(rStr, rCurrentLanguage.GetLanguageTag().getLocale(), 0); + rStr = rNatNum.getNativeNumberString(rStr, rCurrentLanguage.GetLanguageTag().getLocale(), 0); } } @@ -3852,7 +3852,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s SvNumFormatType& F_Type, // IN: old type, OUT: new type double& fOutNumber, // OUT: number if convertible const SvNumberformat* pFormat, // maybe a number format to match against - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, SvNumInputOptions eInputOptions ) { bool res; // return value @@ -3872,7 +3872,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s // NoMoreUpperNeeded, all comparisons on UpperCase OUString aString = mrCurrentLanguageData.GetCharClass()->uppercase( rString ); // convert native number to ASCII if necessary - TransformInput(pNatNum, mrCurrentLanguageData, aString); + TransformInput(rNatNum, mrCurrentLanguageData, aString); res = IsNumberFormatMain( aString, pFormat ); } diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx index fbcb615926bd..8765697cb5f9 100644 --- a/svl/source/numbers/zforfind.hxx +++ b/svl/source/numbers/zforfind.hxx @@ -51,7 +51,7 @@ public: SvNumFormatType& F_Type, /// format type (in + out) double& fOutNumber, /// value determined (out) const SvNumberformat* pFormat, /// number format to which compare against - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, SvNumInputOptions eInputOptions); /// after IsNumberFormat: get decimal position diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 87a8a9cecd2c..e8f3331916d7 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -624,7 +624,7 @@ const css::uno::Reference<css::uno::XComponentContext>& SvNumberFormatter::GetCo return m_xContext; } -const NativeNumberWrapper* SvNumberFormatter::GetNatNum() const { return xNatNum.get(); } +const NativeNumberWrapper& SvNumberFormatter::GetNatNum() const { return xNatNum.get(); } bool SvNFFormatData::IsTextFormat(sal_uInt32 F_Index) const { @@ -639,7 +639,7 @@ bool SvNumberFormatter::IsTextFormat(sal_uInt32 F_Index) const } bool SvNFFormatData::PutEntry(SvNFLanguageData& rCurrentLanguage, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, OUString& rString, sal_Int32& nCheckPos, SvNumFormatType& nType, @@ -660,7 +660,7 @@ bool SvNFFormatData::PutEntry(SvNFLanguageData& rCurrentLanguage, std::unique_ptr<SvNumberformat> p_Entry(new SvNumberformat(rString, rCurrentLanguage.pFormatScanner.get(), rCurrentLanguage.pStringScanner.get(), - pNatNum, + rNatNum, nCheckPos, eLge, bReplaceBooleanEquivalent)); @@ -679,7 +679,7 @@ bool SvNFFormatData::PutEntry(SvNFLanguageData& rCurrentLanguage, nType = SvNumFormatType::DEFINED; } - sal_uInt32 CLOffset = ImpGenerateCL(rCurrentLanguage, pNatNum, eLge); // create new standard formats if necessary + sal_uInt32 CLOffset = ImpGenerateCL(rCurrentLanguage, rNatNum, eLge); // create new standard formats if necessary nKey = ImpIsEntry(p_Entry->GetFormatstring(),CLOffset, eLge); if (nKey == NUMBERFORMAT_ENTRY_NOT_FOUND) // only in not yet present @@ -958,15 +958,15 @@ void SvNumberFormatter::FillKeywordTableForExcel( NfKeywordTable& rKeywords ) rKeywords[ NF_KEY_THAI_T ] = "T"; } -static OUString lcl_buildBooleanStringFormat(const SvNumberformat* pEntry, const NativeNumberWrapper* pNatNum, const SvNFLanguageData& rCurrentLang) +static OUString lcl_buildBooleanStringFormat(const SvNumberformat* pEntry, const NativeNumberWrapper& rNatNum, const SvNFLanguageData& rCurrentLang) { // Build Boolean number format, which needs non-zero and zero subformat // codes with TRUE and FALSE strings. const Color* pColor = nullptr; OUString aFormatStr, aTemp; - pEntry->GetOutputString( 1.0, aTemp, &pColor, pNatNum, rCurrentLang ); + pEntry->GetOutputString( 1.0, aTemp, &pColor, rNatNum, rCurrentLang ); aFormatStr += "\"" + aTemp + "\";\"" + aTemp + "\";\""; - pEntry->GetOutputString( 0.0, aTemp, &pColor, pNatNum, rCurrentLang ); + pEntry->GetOutputString( 0.0, aTemp, &pColor, rNatNum, rCurrentLang ); aFormatStr += aTemp + "\""; return aFormatStr; } @@ -1164,7 +1164,7 @@ SvNumberFormatTable& SvNumberFormatter::GetFirstEntryTable( return GetEntryTable(eTypetmp, FIndex, rLnge); } -sal_uInt32 SvNFFormatData::ImpGenerateCL(SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper* pNatNum, LanguageType eLnge) +sal_uInt32 SvNFFormatData::ImpGenerateCL(SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper& rNatNum, LanguageType eLnge) { rCurrentLanguage.ChangeIntl(eLnge); sal_uInt32 CLOffset = ImpGetCLOffset(rCurrentLanguage.ActLnge); @@ -1214,7 +1214,7 @@ sal_uInt32 SvNFFormatData::ImpGenerateCL(SvNFLanguageData& rCurrentLanguage, con } MaxCLOffset += SV_COUNTRY_LANGUAGE_OFFSET; - ImpGenerateFormats(rCurrentLanguage, pNatNum, MaxCLOffset, false/*bNoAdditionalFormats*/ ); + ImpGenerateFormats(rCurrentLanguage, rNatNum, MaxCLOffset, false/*bNoAdditionalFormats*/ ); CLOffset = MaxCLOffset; } return CLOffset; @@ -1284,7 +1284,7 @@ SvNumberFormatTable& SvNumberFormatter::GetEntryTable( namespace { const SvNumberformat* ImpSubstituteEntry(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, const SvNFEngine::Accessor& rFuncs, + const NativeNumberWrapper& rNatNum, const SvNFEngine::Accessor& rFuncs, const SvNumberformat* pFormat, sal_uInt32* o_pRealKey) { if (!pFormat || !pFormat->IsSubstituted()) @@ -1298,13 +1298,13 @@ const SvNumberformat* ImpSubstituteEntry(SvNFLanguageData& rCurrentLanguage, con if (pFormat->IsSystemTimeFormat()) { /* TODO: should we have NF_TIME_SYSTEM for consistency? */ - nKey = SvNFEngine::GetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, + nKey = SvNFEngine::GetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, SvNumFormatType::TIME, LANGUAGE_SYSTEM); } else if (pFormat->IsSystemLongDateFormat()) /* TODO: either that above, or have a long option for GetStandardFormat() */ { - nKey = SvNFEngine::GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, + nKey = SvNFEngine::GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATE_SYSTEM_LONG, LANGUAGE_SYSTEM); } else @@ -1319,7 +1319,7 @@ const SvNumberformat* ImpSubstituteEntry(SvNFLanguageData& rCurrentLanguage, con bool SvNFEngine::IsNumberFormat(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, const Accessor& rFuncs, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, const OUString& sString, sal_uInt32& F_Index, double& fOutNumber, @@ -1329,7 +1329,7 @@ bool SvNFEngine::IsNumberFormat(SvNFLanguageData& rCurrentLanguage, // For the 0 General format directly use the init/system locale and avoid // all overhead that is associated with a format passed to the scanner. const SvNumberformat* pFormat = (F_Index == 0 ? nullptr : - ::ImpSubstituteEntry(rCurrentLanguage, rFormatData, pNatNum, rFuncs, rFormatData.GetFormatEntry(F_Index), nullptr)); + ::ImpSubstituteEntry(rCurrentLanguage, rFormatData, rNatNum, rFuncs, rFormatData.GetFormatEntry(F_Index), nullptr)); if (!pFormat) { rCurrentLanguage.ChangeIntl(rCurrentLanguage.IniLnge); @@ -1360,7 +1360,7 @@ bool SvNFEngine::IsNumberFormat(SvNFLanguageData& rCurrentLanguage, } else { - res = rCurrentLanguage.pStringScanner->IsNumberFormat(sString, RType, fOutNumber, pFormat, pNatNum, eInputOptions); + res = rCurrentLanguage.pStringScanner->IsNumberFormat(sString, RType, fOutNumber, pFormat, rNatNum, eInputOptions); } if (res && !SvNumberFormatter::IsCompatible(FType, RType)) // non-matching type { @@ -1370,11 +1370,11 @@ bool SvNFEngine::IsNumberFormat(SvNFLanguageData& rCurrentLanguage, // Preserve ISO 8601 input. if (rCurrentLanguage.pStringScanner->CanForceToIso8601( DateOrder::Invalid)) { - F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATE_DIN_YYYYMMDD, rCurrentLanguage.ActLnge ); + F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATE_DIN_YYYYMMDD, rCurrentLanguage.ActLnge ); } else { - F_Index = GetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, RType, rCurrentLanguage.ActLnge); + F_Index = GetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, RType, rCurrentLanguage.ActLnge); } break; case SvNumFormatType::TIME : @@ -1383,20 +1383,20 @@ bool SvNFEngine::IsNumberFormat(SvNFLanguageData& rCurrentLanguage, // 100th seconds if ( rCurrentLanguage.pStringScanner->GetNumericsCount() > 3 || fOutNumber < 0.0 ) { - F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_TIME_HH_MMSS00, rCurrentLanguage.ActLnge); + F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_TIME_HH_MMSS00, rCurrentLanguage.ActLnge); } else { - F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_TIME_MMSS00, rCurrentLanguage.ActLnge); + F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_TIME_MMSS00, rCurrentLanguage.ActLnge); } } else if ( fOutNumber >= 1.0 || fOutNumber < 0.0 ) { - F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_TIME_HH_MMSS, rCurrentLanguage.ActLnge); + F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_TIME_HH_MMSS, rCurrentLanguage.ActLnge); } else { - F_Index = GetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, RType, rCurrentLanguage.ActLnge ); + F_Index = GetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, RType, rCurrentLanguage.ActLnge ); } break; case SvNumFormatType::DATETIME : @@ -1404,24 +1404,24 @@ bool SvNFEngine::IsNumberFormat(SvNFLanguageData& rCurrentLanguage, if (rCurrentLanguage.pStringScanner->HasIso8601Tsep()) { if (rCurrentLanguage.pStringScanner->GetDecPos()) - F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS000, rCurrentLanguage.ActLnge); + F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS000, rCurrentLanguage.ActLnge); else - F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS, rCurrentLanguage.ActLnge); + F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS, rCurrentLanguage.ActLnge); } else if (rCurrentLanguage.pStringScanner->CanForceToIso8601( DateOrder::Invalid)) { if (rCurrentLanguage.pStringScanner->GetDecPos()) - F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS000, rCurrentLanguage.ActLnge); + F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS000, rCurrentLanguage.ActLnge); else - F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS, rCurrentLanguage.ActLnge); + F_Index = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS, rCurrentLanguage.ActLnge); } else { - F_Index = GetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, RType, rCurrentLanguage.ActLnge); + F_Index = GetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, RType, rCurrentLanguage.ActLnge); } break; default: - F_Index = GetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, RType, rCurrentLanguage.ActLnge); + F_Index = GetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, RType, rCurrentLanguage.ActLnge); } } return res; @@ -1577,18 +1577,18 @@ namespace { } bool ImpIsSpecialStandardFormat(SvNFLanguageData& rCurrentLanguage, - const NativeNumberWrapper* pNatNum, const SvNFEngine::Accessor& rFuncs, + const NativeNumberWrapper& rNatNum, const SvNFEngine::Accessor& rFuncs, sal_uInt32 nFIndex, LanguageType eLnge) { eLnge = rCurrentLanguage.ImpResolveLanguage(eLnge); - sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, pNatNum, eLnge); // create new standard formats if necessary (and allowed) + sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, rNatNum, eLnge); // create new standard formats if necessary (and allowed) return ::ImpIsSpecialStandardFormat(nFIndex, nCLOffset); } } sal_uInt32 SvNFEngine::ImpGetStandardFormat(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, const SvNFEngine::Accessor& rFuncs, SvNumFormatType eType, sal_uInt32 CLOffset, @@ -1597,7 +1597,7 @@ sal_uInt32 SvNFEngine::ImpGetStandardFormat(SvNFLanguageData& rCurrentLanguage, switch(eType) { case SvNumFormatType::CURRENCY: - return rFuncs.mGetDefaultCurrency(rCurrentLanguage, pNatNum, CLOffset, eLnge); + return rFuncs.mGetDefaultCurrency(rCurrentLanguage, rNatNum, CLOffset, eLnge); case SvNumFormatType::DURATION : return ImpGetFormatIndex(NF_TIME_HH_MMSS, CLOffset); case SvNumFormatType::DATE: @@ -1623,15 +1623,15 @@ sal_uInt32 SvNFEngine::ImpGetStandardFormat(SvNFLanguageData& rCurrentLanguage, sal_uInt32 SvNFEngine::GetStandardFormat(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, const Accessor& rFuncs, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, SvNumFormatType eType, LanguageType eLnge) { eLnge = rCurrentLanguage.ImpResolveLanguage(eLnge); - sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, pNatNum, eLnge); // create new standard formats if necessary (and allowed) + sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, rNatNum, eLnge); // create new standard formats if necessary (and allowed) - return ImpGetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, eType, nCLOffset, eLnge); + return ImpGetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, eType, nCLOffset, eLnge); } sal_uInt32 SvNumberFormatter::GetStandardFormat( SvNumFormatType eType, LanguageType eLnge ) @@ -1648,17 +1648,17 @@ bool SvNumberFormatter::ImpIsSpecialStandardFormat(sal_uInt32 nFIndex, LanguageT sal_uInt32 SvNFEngine::GetStandardFormat(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, const Accessor& rFuncs, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, sal_uInt32 nFIndex, SvNumFormatType eType, LanguageType eLnge) { eLnge = rCurrentLanguage.ImpResolveLanguage(eLnge); - sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, pNatNum, eLnge); // create new standard formats if necessary (and allowed) + sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, rNatNum, eLnge); // create new standard formats if necessary (and allowed) if (::ImpIsSpecialStandardFormat(nFIndex, nCLOffset)) return nFIndex; - return ImpGetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, eType, nCLOffset, eLnge); + return ImpGetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, eType, nCLOffset, eLnge); } namespace @@ -1738,7 +1738,7 @@ sal_uInt32 SvNumberFormatter::GetStandardFormat( sal_uInt32 nFIndex, SvNumFormat sal_uInt32 SvNFEngine::GetTimeFormat(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, const Accessor& rFuncs, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, double fNumber, LanguageType eLnge, bool bForceDuration) { bool bSign; @@ -1753,16 +1753,16 @@ sal_uInt32 SvNFEngine::GetTimeFormat(SvNFLanguageData& rCurrentLanguage, if ( floor( fSeconds + 0.5 ) * 100 != floor( fSeconds * 100 + 0.5 ) ) { // with 100th seconds if ( bForceDuration || bSign || fSeconds >= 3600 ) - return GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_TIME_HH_MMSS00, eLnge); + return GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_TIME_HH_MMSS00, eLnge); else - return GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_TIME_MMSS00, eLnge); + return GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_TIME_MMSS00, eLnge); } else { if ( bForceDuration || bSign || fNumber >= 1.0 ) - return GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_TIME_HH_MMSS, eLnge); + return GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_TIME_HH_MMSS, eLnge); else - return GetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, SvNumFormatType::TIME, eLnge); + return GetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, SvNumFormatType::TIME, eLnge); } } @@ -1776,21 +1776,21 @@ sal_uInt32 SvNumberFormatter::GetTimeFormat( double fNumber, LanguageType eLnge, sal_uInt32 SvNFEngine::GetStandardFormat(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, const Accessor& rFuncs, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, double fNumber, sal_uInt32 nFIndex, SvNumFormatType eType, LanguageType eLnge) { - if (::ImpIsSpecialStandardFormat(rCurrentLanguage, pNatNum, rFuncs, nFIndex, eLnge)) + if (::ImpIsSpecialStandardFormat(rCurrentLanguage, rNatNum, rFuncs, nFIndex, eLnge)) return nFIndex; switch( eType ) { case SvNumFormatType::DURATION : - return GetTimeFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, fNumber, eLnge, true); + return GetTimeFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, fNumber, eLnge, true); case SvNumFormatType::TIME : - return GetTimeFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, fNumber, eLnge, false); + return GetTimeFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, fNumber, eLnge, false); default: - return GetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, eType, eLnge ); + return GetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, eType, eLnge ); } } @@ -1850,7 +1850,7 @@ sal_uInt32 SvNumberFormatter::GuessDateTimeFormat( SvNumFormatType& rType, doubl sal_uInt32 SvNFEngine::GetEditFormat(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, const Accessor& rFuncs, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, double fNumber, sal_uInt32 nFIndex, SvNumFormatType eType, const SvNumberformat* pFormat, @@ -1867,25 +1867,25 @@ sal_uInt32 SvNFEngine::GetEditFormat(SvNFLanguageData& rCurrentLanguage, { // Preserve ISO 8601 format. bool bIsoDate = - nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATE_DIN_YYYYMMDD, eLang) || - nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATE_DIN_YYMMDD, eLang) || - nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATE_DIN_MMDD, eLang) || + nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATE_DIN_YYYYMMDD, eLang) || + nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATE_DIN_YYMMDD, eLang) || + nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATE_DIN_MMDD, eLang) || (pFormat && pFormat->IsIso8601( 0 )); if (rtl::math::approxFloor( fNumber) != fNumber) { // fdo#34977 preserve time when editing even if only date was // displayed. if (bIsoDate) - nKey = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS, eForLocale); + nKey = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS, eForLocale); else - nKey = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_SYS_DDMMYYYY_HHMMSS, eForLocale); + nKey = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_SYS_DDMMYYYY_HHMMSS, eForLocale); } else { if (bIsoDate) - nKey = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATE_ISO_YYYYMMDD, eForLocale); + nKey = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATE_ISO_YYYYMMDD, eForLocale); else - nKey = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATE_SYS_DDMMYYYY, eForLocale); + nKey = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATE_SYS_DDMMYYYY, eForLocale); } } break; @@ -1896,36 +1896,36 @@ sal_uInt32 SvNFEngine::GetEditFormat(SvNFLanguageData& rCurrentLanguage, * of a signed 16-bit. 32k hours are 3.7 years ... or * 1903-09-26 if date. */ if (fabs( fNumber) * 24 < 0x7fff) - nKey = GetTimeFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, fNumber, eForLocale, true); + nKey = GetTimeFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, fNumber, eForLocale, true); // Preserve duration, use [HH]:MM:SS instead of time. else - nKey = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_SYS_DDMMYYYY_HHMMSS, eForLocale); + nKey = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_SYS_DDMMYYYY_HHMMSS, eForLocale); // Assume that a large value is a datetime with only time // displayed. } else - nKey = GetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, fNumber, nFIndex, eType, eForLocale); + nKey = GetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, fNumber, nFIndex, eType, eForLocale); break; case SvNumFormatType::DURATION : - nKey = GetTimeFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, fNumber, eForLocale, true); + nKey = GetTimeFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, fNumber, eForLocale, true); break; case SvNumFormatType::DATETIME : - if (nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS, eLang)) - nKey = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS, eForLocale ); - else if (nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS000, eLang)) - nKey = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS000, eForLocale ); - else if (nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS000, eLang)) - nKey = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS000, eForLocale ); - else if (nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS, eLang) || (pFormat && pFormat->IsIso8601( 0 ))) - nKey = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS, eForLocale ); + if (nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS, eLang)) + nKey = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS, eForLocale ); + else if (nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS000, eLang)) + nKey = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDDTHHMMSS000, eForLocale ); + else if (nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS000, eLang)) + nKey = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS000, eForLocale ); + else if (nFIndex == GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS, eLang) || (pFormat && pFormat->IsIso8601( 0 ))) + nKey = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_ISO_YYYYMMDD_HHMMSS, eForLocale ); else - nKey = GetFormatIndex(rCurrentLanguage, rFuncs, pNatNum, NF_DATETIME_SYS_DDMMYYYY_HHMMSS, eForLocale ); + nKey = GetFormatIndex(rCurrentLanguage, rFuncs, rNatNum, NF_DATETIME_SYS_DDMMYYYY_HHMMSS, eForLocale ); break; case SvNumFormatType::NUMBER: - nKey = GetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, eType, eForLocale); + nKey = GetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, eType, eForLocale); break; default: - nKey = GetStandardFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, fNumber, nFIndex, eType, eForLocale ); + nKey = GetStandardFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, fNumber, nFIndex, eType, eForLocale ); } return nKey; } @@ -1943,7 +1943,7 @@ sal_uInt32 SvNumberFormatter::GetEditFormat( double fNumber, sal_uInt32 nFIndex, void SvNFEngine::GetInputLineString(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, const Accessor& rFuncs, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, const double& fOutNumber, sal_uInt32 nFIndex, OUString& sOutString, @@ -1953,7 +1953,7 @@ void SvNFEngine::GetInputLineString(SvNFLanguageData& rCurrentLanguage, sal_uInt32 nRealKey = nFIndex; const SvNumberformat* pFormat = ImpSubstituteEntry(rCurrentLanguage, rFormatData, - pNatNum, rFuncs, + rNatNum, rFuncs, rFormatData.GetFormatEntry(nFIndex), &nRealKey); if (!pFormat) pFormat = rFormatData.GetFormatEntry(ZF_STANDARD); @@ -1991,7 +1991,7 @@ void SvNFEngine::GetInputLineString(SvNFLanguageData& rCurrentLanguage, // if bFiltering true keep the nRealKey format if (!bFiltering) { - sal_uInt32 nKey = GetEditFormat(rCurrentLanguage, rFormatData, pNatNum, rFuncs, + sal_uInt32 nKey = GetEditFormat(rCurrentLanguage, rFormatData, rNatNum, rFuncs, fOutNumber, nRealKey, eType, pFormat, bForceSystemLocale ? LANGUAGE_SYSTEM : LANGUAGE_DONTKNOW); if (nKey != nRealKey) @@ -2007,7 +2007,7 @@ void SvNFEngine::GetInputLineString(SvNFLanguageData& rCurrentLanguage, rCurrentLanguage.ChangeStandardPrec(SvNumberFormatter::INPUTSTRING_PRECISION); bPrecChanged = true; } - pFormat->GetOutputString(fOutNumber, sOutString, &pColor, pNatNum, rCurrentLanguage); + pFormat->GetOutputString(fOutNumber, sOutString, &pColor, rNatNum, rCurrentLanguage); // The #FMT error string must not be used for input as it would lead to // data loss. This can happen for at least date(+time). Fall back to a @@ -2021,7 +2021,7 @@ void SvNFEngine::GetInputLineString(SvNFLanguageData& rCurrentLanguage, { rCurrentLanguage.ChangeStandardPrec(SvNumberFormatter::INPUTSTRING_PRECISION); bPrecChanged = true; - pFormat->GetOutputString(fOutNumber, sOutString, &pColor, pNatNum, rCurrentLanguage); + pFormat->GetOutputString(fOutNumber, sOutString, &pColor, rNatNum, rCurrentLanguage); } } assert(sOutString != ImpSvNumberformatScan::sErrStr); @@ -2081,7 +2081,7 @@ void SvNumberFormatter::GetOutputString(const OUString& sString, void SvNFEngine::GetOutputString(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, const Accessor& rFuncs, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, const double& fOutNumber, sal_uInt32 nFIndex, OUString& sOutString, const Color** ppColor, bool bUseStarFormat) @@ -2092,12 +2092,12 @@ void SvNFEngine::GetOutputString(SvNFLanguageData& rCurrentLanguage, return; } const SvNumberformat* pFormat = ImpSubstituteEntry(rCurrentLanguage, rFormatData, - pNatNum, rFuncs, + rNatNum, rFuncs, rFormatData.GetFormatEntry(nFIndex), nullptr); if (!pFormat) pFormat = rFormatData.GetFormatEntry(ZF_STANDARD); rCurrentLanguage.ChangeIntl(pFormat->GetLanguage()); - pFormat->GetOutputString(fOutNumber, sOutString, ppColor, pNatNum, rCurrentLanguage, bUseStarFormat); + pFormat->GetOutputString(fOutNumber, sOutString, ppColor, rNatNum, rCurrentLanguage, bUseStarFormat); } void SvNumberFormatter::GetOutputString(const double& fOutNumber, @@ -2114,7 +2114,7 @@ void SvNumberFormatter::GetOutputString(const double& fOutNumber, bool SvNFEngine::GetPreviewString(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, const OUString& sFormatString, double fPreviewNumber, @@ -2133,20 +2133,20 @@ bool SvNFEngine::GetPreviewString(SvNFLanguageData& rCurrentLanguage, SvNumberformat aEntry(sTmpString, rCurrentLanguage.pFormatScanner.get(), rCurrentLanguage.pStringScanner.get(), - pNatNum, + rNatNum, nCheckPos, eLnge); if (nCheckPos == 0) // String ok { - sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, pNatNum, eLnge); // create new standard formats if necessary (and allowed) + sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, rNatNum, eLnge); // create new standard formats if necessary (and allowed) sal_uInt32 nKey = rFormatData.ImpIsEntry(aEntry.GetFormatstring(), nCLOffset, eLnge); if (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND) // already present { - GetOutputString(rCurrentLanguage, rFormatData, pNatNum, rFuncs, fPreviewNumber, nKey, sOutString, ppColor, bUseStarFormat); + GetOutputString(rCurrentLanguage, rFormatData, rNatNum, rFuncs, fPreviewNumber, nKey, sOutString, ppColor, bUseStarFormat); } else { - aEntry.GetOutputString(fPreviewNumber, sOutString, ppColor, pNatNum, rCurrentLanguage, bUseStarFormat); + aEntry.GetOutputString(fPreviewNumber, sOutString, ppColor, rNatNum, rCurrentLanguage, bUseStarFormat); } return true; } @@ -2173,7 +2173,7 @@ bool SvNumberFormatter::GetPreviewString(const OUString& sFormatString, bool SvNFEngine::GetPreviewStringGuess(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, const OUString& sFormatString, double fPreviewNumber, @@ -2189,12 +2189,12 @@ bool SvNFEngine::GetPreviewStringGuess(SvNFLanguageData& rCurrentLanguage, bool bEnglish = (eLnge == LANGUAGE_ENGLISH_US); OUString aFormatStringUpper( rCurrentLanguage.xCharClass->uppercase( sFormatString ) ); - sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, pNatNum, eLnge); // create new standard formats if necessary (and allowed) + sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, rNatNum, eLnge); // create new standard formats if necessary (and allowed) sal_uInt32 nKey = rFormatData.ImpIsEntry(aFormatStringUpper, nCLOffset, eLnge); if ( nKey != NUMBERFORMAT_ENTRY_NOT_FOUND ) { // Target format present - GetOutputString(rCurrentLanguage, rFormatData, pNatNum, rFuncs, + GetOutputString(rCurrentLanguage, rFormatData, rNatNum, rFuncs, fPreviewNumber, nKey, sOutString, ppColor, false); return true; } @@ -2207,11 +2207,11 @@ bool SvNFEngine::GetPreviewStringGuess(SvNFLanguageData& rCurrentLanguage, { sTmpString = sFormatString; pEntry.emplace( sTmpString, rCurrentLanguage.pFormatScanner.get(), - rCurrentLanguage.pStringScanner.get(), pNatNum, nCheckPos, eLnge ); + rCurrentLanguage.pStringScanner.get(), rNatNum, nCheckPos, eLnge ); } else { - nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, pNatNum, LANGUAGE_ENGLISH_US); + nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, rNatNum, LANGUAGE_ENGLISH_US); nKey = rFormatData.ImpIsEntry(aFormatStringUpper, nCLOffset, LANGUAGE_ENGLISH_US); bool bEnglishFormat = (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND); @@ -2220,7 +2220,7 @@ bool SvNFEngine::GetPreviewStringGuess(SvNFLanguageData& rCurrentLanguage, rCurrentLanguage.pFormatScanner->SetConvertMode( LANGUAGE_ENGLISH_US, eLnge, false, false); sTmpString = sFormatString; pEntry.emplace( sTmpString, rCurrentLanguage.pFormatScanner.get(), - rCurrentLanguage.pStringScanner.get(), pNatNum, nCheckPos, eFormatLang ); + rCurrentLanguage.pStringScanner.get(), rNatNum, nCheckPos, eFormatLang ); rCurrentLanguage.pFormatScanner->SetConvertMode( false ); rCurrentLanguage.ChangeIntl(eLnge); @@ -2234,7 +2234,7 @@ bool SvNFEngine::GetPreviewStringGuess(SvNFLanguageData& rCurrentLanguage, rCurrentLanguage.pFormatScanner->ChangeIntl( ImpSvNumberformatScan::KeywordLocalization::LocaleLegacy ); sTmpString = sFormatString; pEntry.emplace( sTmpString, rCurrentLanguage.pFormatScanner.get(), - rCurrentLanguage.pStringScanner.get(), pNatNum, nCheckPos, eLnge ); + rCurrentLanguage.pStringScanner.get(), rNatNum, nCheckPos, eLnge ); } else { @@ -2245,7 +2245,7 @@ bool SvNFEngine::GetPreviewStringGuess(SvNFLanguageData& rCurrentLanguage, rCurrentLanguage.pFormatScanner->SetConvertMode( eLnge, LANGUAGE_ENGLISH_US, false, false); sTmpString = sFormatString; SvNumberformat aEntry2( sTmpString, rCurrentLanguage.pFormatScanner.get(), - rCurrentLanguage.pStringScanner.get(), pNatNum, nCheckPos2, eFormatLang ); + rCurrentLanguage.pStringScanner.get(), rNatNum, nCheckPos2, eFormatLang ); rCurrentLanguage.pFormatScanner->SetConvertMode( false ); rCurrentLanguage.ChangeIntl(eLnge); if ( nCheckPos2 == 0 && !rCurrentLanguage.xTransliteration->isEqual( sFormatString, @@ -2256,7 +2256,7 @@ bool SvNFEngine::GetPreviewStringGuess(SvNFLanguageData& rCurrentLanguage, rCurrentLanguage.pFormatScanner->ChangeIntl( ImpSvNumberformatScan::KeywordLocalization::LocaleLegacy ); sTmpString = sFormatString; pEntry.emplace( sTmpString, rCurrentLanguage.pFormatScanner.get(), - rCurrentLanguage.pStringScanner.get(), pNatNum, nCheckPos, eLnge ); + rCurrentLanguage.pStringScanner.get(), rNatNum, nCheckPos, eLnge ); } } } @@ -2264,8 +2264,8 @@ bool SvNFEngine::GetPreviewStringGuess(SvNFLanguageData& rCurrentLanguage, if (nCheckPos == 0) // String ok { - rFuncs.mGetCLOffset(rCurrentLanguage, pNatNum, eLnge); // create new standard formats if necessary - pEntry->GetOutputString( fPreviewNumber, sOutString, ppColor, pNatNum, rCurrentLanguage ); + rFuncs.mGetCLOffset(rCurrentLanguage, rNatNum, eLnge); // create new standard formats if necessary + pEntry->GetOutputString( fPreviewNumber, sOutString, ppColor, rNatNum, rCurrentLanguage ); return true; } return false; @@ -2286,7 +2286,7 @@ bool SvNumberFormatter::GetPreviewStringGuess( const OUString& sFormatString, bool SvNFEngine::GetPreviewString(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, const OUString& sFormatString, const OUString& sPreviewString, @@ -2304,13 +2304,13 @@ bool SvNFEngine::GetPreviewString(SvNFLanguageData& rCurrentLanguage, SvNumberformat aEntry( sTmpString, rCurrentLanguage.pFormatScanner.get(), rCurrentLanguage.pStringScanner.get(), - pNatNum, + rNatNum, nCheckPos, eLnge); if (nCheckPos == 0) // String ok { // May have to create standard formats for this locale. - sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, pNatNum, eLnge); + sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, rNatNum, eLnge); sal_uInt32 nKey = rFormatData.ImpIsEntry( aEntry.GetFormatstring(), nCLOffset, eLnge); if (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND) // already present { @@ -2390,7 +2390,7 @@ sal_uInt32 SvNumberFormatter::TestNewString(const OUString& sFormatString, } SvNumberformat* SvNFFormatData::ImpInsertFormat(SvNFLanguageData& rCurrentLanguage, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, const css::i18n::NumberFormatCode& rCode, sal_uInt32 nPos, bool bAfterChangingSystemCL, sal_Int16 nOrgIndex) @@ -2426,7 +2426,7 @@ SvNumberformat* SvNFFormatData::ImpInsertFormat(SvNFLanguageData& rCurrentLangua std::unique_ptr<SvNumberformat> pFormat(new SvNumberformat(aCodeStr, rCurrentLanguage.pFormatScanner.get(), rCurrentLanguage.pStringScanner.get(), - pNatNum, + rNatNum, nCheckPos, rCurrentLanguage.ActLnge)); if (nCheckPos != 0) @@ -2903,7 +2903,7 @@ const SvNumberformat* SvNumberFormatter::ImpSubstituteEntry( const SvNumberforma return ::ImpSubstituteEntry(m_aCurrentLanguage, m_aFormatData, GetNatNum(), m_aRWPolicy, pFormat, o_pRealKey); } -void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper* pNatNum, sal_uInt32 CLOffset, bool bNoAdditionalFormats ) +void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper& rNatNum, sal_uInt32 CLOffset, bool bNoAdditionalFormats ) { bool bOldConvertMode = rCurrentLanguage.pFormatScanner->GetConvertMode(); if (bOldConvertMode) @@ -2921,7 +2921,7 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons // General nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_NUMBER_STANDARD ); - SvNumberformat* pStdFormat = ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + SvNumberformat* pStdFormat = ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD /* NF_NUMBER_STANDARD */ ); if (pStdFormat) { @@ -2950,7 +2950,7 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons sal_Int32 nCheckPos = 0; std::unique_ptr<SvNumberformat> pNewFormat(new SvNumberformat( aFormatCode, rCurrentLanguage.pFormatScanner.get(), - rCurrentLanguage.pStringScanner.get(), pNatNum, nCheckPos, rCurrentLanguage.ActLnge )); + rCurrentLanguage.pStringScanner.get(), rNatNum, nCheckPos, rCurrentLanguage.ActLnge )); pNewFormat->SetType(SvNumFormatType::LOGICAL); pNewFormat->SetStandard(); if ( !aFTable.emplace(CLOffset + ZF_STANDARD_LOGICAL /* NF_BOOLEAN */, @@ -2962,7 +2962,7 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons // Text aFormatCode = "@"; pNewFormat.reset(new SvNumberformat( aFormatCode, rCurrentLanguage.pFormatScanner.get(), - rCurrentLanguage.pStringScanner.get(), pNatNum, nCheckPos, rCurrentLanguage.ActLnge )); + rCurrentLanguage.pStringScanner.get(), rNatNum, nCheckPos, rCurrentLanguage.ActLnge )); pNewFormat->SetType(SvNumFormatType::TEXT); pNewFormat->SetStandard(); if ( !aFTable.emplace( CLOffset + ZF_STANDARD_TEXT /* NF_TEXT */, @@ -2974,27 +2974,27 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons // 0 nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_NUMBER_INT ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD+1 /* NF_NUMBER_INT */ ); // 0.00 nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_NUMBER_DEC2 ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD+2 /* NF_NUMBER_DEC2 */ ); // #,##0 nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_NUMBER_1000INT ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD+3 /* NF_NUMBER_1000INT */ ); // #,##0.00 nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_NUMBER_1000DEC2 ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD+4 /* NF_NUMBER_1000DEC2 */ ); // #.##0,00 System country/language dependent nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_NUMBER_SYSTEM ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD+5 /* NF_NUMBER_SYSTEM */ ); @@ -3004,12 +3004,12 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons // 0% nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_PERCENT_INT ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_PERCENT /* NF_PERCENT_INT */ ); // 0.00% nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_PERCENT_DEC2 ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_PERCENT+1 /* NF_PERCENT_DEC2 */ ); @@ -3027,42 +3027,42 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons // Just copy the format, to avoid COW on sequence after each possible reallocation auto aFormat = aFormatSeq[nIdx]; aFormat.Default = false; - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormat, + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormat, CLOffset + ZF_STANDARD_CURRENCY /* NF_CURRENCY_1000INT */ ); // #,##0.00 nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_CURRENCY_1000DEC2 ); aFormat = aFormatSeq[nIdx]; aFormat.Default = false; - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormat, + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormat, CLOffset + ZF_STANDARD_CURRENCY+1 /* NF_CURRENCY_1000DEC2 */ ); // #,##0 negative red nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_CURRENCY_1000INT_RED ); aFormat = aFormatSeq[nIdx]; aFormat.Default = false; - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormat, + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormat, CLOffset + ZF_STANDARD_CURRENCY+2 /* NF_CURRENCY_1000INT_RED */ ); // #,##0.00 negative red nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_CURRENCY_1000DEC2_RED ); aFormat = aFormatSeq[nIdx]; aFormat.Default = false; - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormat, + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormat, CLOffset + ZF_STANDARD_CURRENCY+3 /* NF_CURRENCY_1000DEC2_RED */ ); // #,##0.00 USD nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_CURRENCY_1000DEC2_CCC ); aFormat = aFormatSeq[nIdx]; aFormat.Default = false; - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormat, + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormat, CLOffset + ZF_STANDARD_CURRENCY+4 /* NF_CURRENCY_1000DEC2_CCC */ ); // #.##0,-- nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_CURRENCY_1000DEC2_DASHED ); aFormat = aFormatSeq[nIdx]; aFormat.Default = false; - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormat, + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormat, CLOffset + ZF_STANDARD_CURRENCY+5 /* NF_CURRENCY_1000DEC2_DASHED */ ); @@ -3072,107 +3072,107 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons // DD.MM.YY System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYSTEM_SHORT ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE /* NF_DATE_SYSTEM_SHORT */ ); // NN DD.MMM YY nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_DEF_NNDDMMMYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE+1 /* NF_DATE_DEF_NNDDMMMYY */ ); // DD.MM.YY def/System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYS_MMYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE+2 /* NF_DATE_SYS_MMYY */ ); // DD MMM nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYS_DDMMM ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE+3 /* NF_DATE_SYS_DDMMM */ ); // MMMM nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_MMMM ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE+4 /* NF_DATE_MMMM */ ); // QQ YY nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_QQJJ ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE+5 /* NF_DATE_QQJJ */ ); // DD.MM.YYYY was DD.MM.[YY]YY nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYS_DDMMYYYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE+6 /* NF_DATE_SYS_DDMMYYYY */ ); // DD.MM.YY def/System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYS_DDMMYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE+7 /* NF_DATE_SYS_DDMMYY */ ); // NNN, D. MMMM YYYY System // Long day of week: "NNNN" instead of "NNN," because of compatibility nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYSTEM_LONG ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE+8 /* NF_DATE_SYSTEM_LONG */ ); // Hard coded but system (regional settings) delimiters dependent long date formats // D. MMM YY def/System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYS_DMMMYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE+9 /* NF_DATE_SYS_DMMMYY */ ); // D. MMM YYYY def/System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYS_DMMMYYYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE_SYS_DMMMYYYY /* NF_DATE_SYS_DMMMYYYY */ ); // D. MMMM YYYY def/System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYS_DMMMMYYYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE_SYS_DMMMMYYYY /* NF_DATE_SYS_DMMMMYYYY */ ); // NN, D. MMM YY def/System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYS_NNDMMMYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE_SYS_NNDMMMYY /* NF_DATE_SYS_NNDMMMYY */ ); // NN, D. MMMM YYYY def/System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYS_NNDMMMMYYYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE_SYS_NNDMMMMYYYY /* NF_DATE_SYS_NNDMMMMYYYY */ ); // NNN, D. MMMM YYYY def/System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_SYS_NNNNDMMMMYYYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE_SYS_NNNNDMMMMYYYY /* NF_DATE_SYS_NNNNDMMMMYYYY */ ); // Hard coded DIN (Deutsche Industrie Norm) and EN (European Norm) date formats // D. MMM. YYYY DIN/EN nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_DIN_DMMMYYYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE_DIN_DMMMYYYY /* NF_DATE_DIN_DMMMYYYY */ ); // D. MMMM YYYY DIN/EN nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_DIN_DMMMMYYYY ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE_DIN_DMMMMYYYY /* NF_DATE_DIN_DMMMMYYYY */ ); // MM-DD DIN/EN nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_DIN_MMDD ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE_DIN_MMDD /* NF_DATE_DIN_MMDD */ ); // YY-MM-DD DIN/EN nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_DIN_YYMMDD ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE_DIN_YYMMDD /* NF_DATE_DIN_YYMMDD */ ); // YYYY-MM-DD DIN/EN/ISO nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATE_DIN_YYYYMMDD ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATE_DIN_YYYYMMDD /* NF_DATE_DIN_YYYYMMDD */ ); @@ -3182,37 +3182,37 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons // HH:MM nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_TIME_HHMM ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_TIME /* NF_TIME_HHMM */ ); // HH:MM:SS nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_TIME_HHMMSS ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_TIME+1 /* NF_TIME_HHMMSS */ ); // HH:MM AM/PM nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_TIME_HHMMAMPM ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_TIME+2 /* NF_TIME_HHMMAMPM */ ); // HH:MM:SS AM/PM nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_TIME_HHMMSSAMPM ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_TIME+3 /* NF_TIME_HHMMSSAMPM */ ); // [HH]:MM:SS nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_TIME_HH_MMSS ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_TIME+4 /* NF_TIME_HH_MMSS */ ); // MM:SS,00 nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_TIME_MMSS00 ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_TIME+5 /* NF_TIME_MMSS00 */ ); // [HH]:MM:SS,00 nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_TIME_HH_MMSS00 ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_TIME+6 /* NF_TIME_HH_MMSS00 */ ); @@ -3222,17 +3222,17 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons // DD.MM.YY HH:MM System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATETIME_SYSTEM_SHORT_HHMM ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATETIME /* NF_DATETIME_SYSTEM_SHORT_HHMM */ ); // DD.MM.YYYY HH:MM:SS System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATETIME_SYS_DDMMYYYY_HHMMSS ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATETIME+1 /* NF_DATETIME_SYS_DDMMYYYY_HHMMSS */ ); // DD.MM.YYYY HH:MM System nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_DATETIME_SYS_DDMMYYYY_HHMM ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_DATETIME+2 /* NF_DATETIME_SYS_DDMMYYYY_HHMM */ ); const NfKeywordTable & rKeyword = rCurrentLanguage.pFormatScanner->GetKeywords(); @@ -3247,7 +3247,7 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons rKeyword[NF_KEY_HH] + ":" + rKeyword[NF_KEY_MMI] + ":" + rKeyword[NF_KEY_SS]; - SvNumberformat* pFormat = ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + SvNumberformat* pFormat = ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_DATETIME+3 /* NF_DATETIME_ISO_YYYYMMDD_HHMMSS */ ); assert(pFormat); @@ -3261,7 +3261,7 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons rKeyword[NF_KEY_MMI] + ":" + rKeyword[NF_KEY_SS] + rCurrentLanguage.GetLocaleData()->getTime100SecSep() + "000"; - pFormat = ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + pFormat = ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_DATETIME+4 /* NF_DATETIME_ISO_YYYYMMDD_HHMMSS000 */ ); assert(pFormat); @@ -3273,7 +3273,7 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons rKeyword[NF_KEY_HH] + ":" + rKeyword[NF_KEY_MMI] + ":" + rKeyword[NF_KEY_SS]; - pFormat = ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + pFormat = ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_DATETIME+5 /* NF_DATETIME_ISO_YYYYMMDDTHHMMSS */ ); assert(pFormat); pFormat->SetComment("ISO 8601"); // not to be localized @@ -3287,7 +3287,7 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons rKeyword[NF_KEY_MMI] + ":" + rKeyword[NF_KEY_SS] + (rCurrentLanguage.GetLocaleData()->getTime100SecSep() == "." ? "." : ",") + "000"; - pFormat = ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + pFormat = ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_DATETIME+6 /* NF_DATETIME_ISO_YYYYMMDDTHHMMSS000 */ ); assert(pFormat); pFormat->SetComment("ISO 8601"); // not to be localized @@ -3299,12 +3299,12 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons // 0.00E+000 nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_SCIENTIFIC_000E000 ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_SCIENTIFIC /* NF_SCIENTIFIC_000E000 */ ); // 0.00E+00 nIdx = ImpGetFormatCodeIndex(rCurrentLanguage, aFormatSeq, NF_SCIENTIFIC_000E00 ); - ImpInsertFormat(rCurrentLanguage, pNatNum, aFormatSeq[nIdx], + ImpInsertFormat(rCurrentLanguage, rNatNum, aFormatSeq[nIdx], CLOffset + ZF_STANDARD_SCIENTIFIC+1 /* NF_SCIENTIFIC_000E00 */ ); @@ -3313,62 +3313,62 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons // # ?/? aSingleFormatCode.Code = "# ?/?"; - ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_FRACTION /* NF_FRACTION_1D */ ); // # ??/?? //! "??/" would be interpreted by the compiler as a trigraph for '\' aSingleFormatCode.Code = "# ?\?/?\?"; - ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_FRACTION+1 /* NF_FRACTION_2D */ ); // # ???/??? //! "??/" would be interpreted by the compiler as a trigraph for '\' aSingleFormatCode.Code = "# ?\?\?/?\?\?"; - ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_FRACTION+2 /* NF_FRACTION_3D */ ); // # ?/2 aSingleFormatCode.Code = "# ?/2"; - ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_FRACTION+3 /* NF_FRACTION_2 */ ); // # ?/4 aSingleFormatCode.Code = "# ?/4"; - ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_FRACTION+4 /* NF_FRACTION_4 */ ); // # ?/8 aSingleFormatCode.Code = "# ?/8"; - ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_FRACTION+5 /* NF_FRACTION_8 */ ); // # ??/16 aSingleFormatCode.Code = "# ?\?/16"; - ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_FRACTION+6 /* NF_FRACTION_16 */ ); // # ??/10 aSingleFormatCode.Code = "# ?\?/10"; - ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_FRACTION+7 /* NF_FRACTION_10 */ ); // # ??/100 aSingleFormatCode.Code = "# ?\?/100"; - ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_FRACTION+8 /* NF_FRACTION_100 */ ); // Week of year aSingleFormatCode.Code = rKeyword[NF_KEY_WW]; - ImpInsertFormat(rCurrentLanguage, pNatNum, aSingleFormatCode, + ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_DATE_WW /* NF_DATE_WW */ ); // Now all additional format codes provided by I18N, but only if not // changing SystemCL, then they are appended last after user defined. if ( !bNoAdditionalFormats ) { - ImpGenerateAdditionalFormats(rCurrentLanguage, pNatNum, CLOffset, xNFC, false); + ImpGenerateAdditionalFormats(rCurrentLanguage, rNatNum, CLOffset, xNFC, false); } if (bOldConvertMode) { @@ -3377,7 +3377,7 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons } void SvNFFormatData::ImpGenerateAdditionalFormats(SvNFLanguageData& rCurrentLanguage, - const NativeNumberWrapper* pNatNum, sal_uInt32 CLOffset, + const NativeNumberWrapper& rNatNum, sal_uInt32 CLOffset, css::uno::Reference< css::i18n::XNumberFormatCode > const & rNumberFormatCode, bool bAfterChangingSystemCL ) { @@ -3413,7 +3413,7 @@ void SvNFFormatData::ImpGenerateAdditionalFormats(SvNFLanguageData& rCurrentLang //! no default on currency bool bDefault = rFormat.Default; rFormat.Default = false; - if ( SvNumberformat* pNewFormat = ImpInsertFormat(rCurrentLanguage, pNatNum, rFormat, nPos+1, + if ( SvNumberformat* pNewFormat = ImpInsertFormat(rCurrentLanguage, rNatNum, rFormat, nPos+1, bAfterChangingSystemCL, nOrgIndex ) ) { pNewFormat->SetAdditionalBuiltin(); @@ -3440,7 +3440,7 @@ void SvNFFormatData::ImpGenerateAdditionalFormats(SvNFLanguageData& rCurrentLang } if ( rFormat.Index >= NF_INDEX_TABLE_RESERVED_START ) { - if ( SvNumberformat* pNewFormat = ImpInsertFormat(rCurrentLanguage, pNatNum, rFormat, nPos+1, + if ( SvNumberformat* pNewFormat = ImpInsertFormat(rCurrentLanguage, rNatNum, rFormat, nPos+1, bAfterChangingSystemCL ) ) { pNewFormat->SetAdditionalBuiltin(); @@ -3499,7 +3499,7 @@ sal_Int32 ImpPosToken(const OUStringBuffer & sFormat, sal_Unicode token, sal_Int OUString SvNFEngine::GenerateFormat(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, const Accessor& rFuncs, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, sal_uInt32 nIndex, LanguageType eLnge, bool bThousand, @@ -3511,7 +3511,7 @@ OUString SvNFEngine::GenerateFormat(SvNFLanguageData& rCurrentLanguage, const SvNumberformat* pFormat = rFormatData.GetFormatEntry( nIndex ); const SvNumFormatType eType = (pFormat ? pFormat->GetMaskedType() : SvNumFormatType::UNDEFINED); - rFuncs.mGetCLOffset(rCurrentLanguage, pNatNum, eLnge); // create new standard formats if necessary (and allowed) + rFuncs.mGetCLOffset(rCurrentLanguage, rNatNum, eLnge); // create new standard formats if necessary (and allowed) utl::DigitGroupingIterator aGrouping( rCurrentLanguage.xLocaleData->getDigitGrouping()); // always group of 3 for Engineering notation @@ -3770,12 +3770,12 @@ sal_uInt32 SvNumberFormatter::GetEntryKey(std::u16string_view sStr, sal_uInt32 SvNFEngine::GetStandardIndex(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, LanguageType eLnge) { return SvNFEngine::GetStandardFormat(rCurrentLanguage, rFormatData, - pNatNum, rFuncs, + rNatNum, rFuncs, SvNumFormatType::NUMBER, eLnge); } @@ -3908,7 +3908,7 @@ namespace } } -sal_uInt32 SvNFEngine::GetCLOffsetRO(const SvNFFormatData& rFormatData, SvNFLanguageData&, const NativeNumberWrapper*, LanguageType eLnge) +sal_uInt32 SvNFEngine::GetCLOffsetRO(const SvNFFormatData& rFormatData, SvNFLanguageData&, const NativeNumberWrapper&, LanguageType eLnge) { sal_uInt32 nCLOffset = rFormatData.ImpGetCLOffset(eLnge); assert(nCLOffset <= rFormatData.MaxCLOffset && "Language must have already been encountered"); @@ -3930,9 +3930,9 @@ sal_uInt32 SvNFEngine::FindFormatRO(const SvNFFormatData& rFormatData, const SvN return ::FindCachedDefaultFormat(rFormatCache, nSearch); } -sal_uInt32 SvNFEngine::GetCLOffsetRW(SvNFFormatData& rFormatData, SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper* pNatNum, LanguageType eLnge) +sal_uInt32 SvNFEngine::GetCLOffsetRW(SvNFFormatData& rFormatData, SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper& rNatNum, LanguageType eLnge) { - return rFormatData.ImpGenerateCL(rCurrentLanguage, pNatNum, eLnge); // create new standard formats if necessary + return rFormatData.ImpGenerateCL(rCurrentLanguage, rNatNum, eLnge); // create new standard formats if necessary } void SvNFEngine::CacheFormatRW(SvNFFormatData& rFormatData, sal_uInt32 nSearch, sal_uInt32 nFormat) @@ -3945,14 +3945,14 @@ sal_uInt32 SvNFEngine::FindFormatRW(const SvNFFormatData& rFormatData, sal_uInt3 return rFormatData.FindCachedDefaultFormat(nSearch); } -sal_uInt32 SvNFEngine::DefaultCurrencyRW(SvNFFormatData& rFormatData, SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper* pNatNum, sal_uInt32 CLOffset, LanguageType eLnge) +sal_uInt32 SvNFEngine::DefaultCurrencyRW(SvNFFormatData& rFormatData, SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper& rNatNum, sal_uInt32 CLOffset, LanguageType eLnge) { if (eLnge == LANGUAGE_SYSTEM) - return rFormatData.ImpGetDefaultSystemCurrencyFormat(rCurrentLanguage, pNatNum); - return rFormatData.ImpGetDefaultCurrencyFormat(rCurrentLanguage, pNatNum, CLOffset, eLnge); + return rFormatData.ImpGetDefaultSystemCurrencyFormat(rCurrentLanguage, rNatNum); + return rFormatData.ImpGetDefaultCurrencyFormat(rCurrentLanguage, rNatNum, CLOffset, eLnge); } -sal_uInt32 SvNFEngine::DefaultCurrencyRO(const SvNFFormatData& rFormatData, SvNFLanguageData&, const NativeNumberWrapper*, sal_uInt32 CLOffset, LanguageType eLnge) +sal_uInt32 SvNFEngine::DefaultCurrencyRO(const SvNFFormatData& rFormatData, SvNFLanguageData&, const NativeNumberWrapper&, sal_uInt32 CLOffset, LanguageType eLnge) { if (eLnge == LANGUAGE_SYSTEM) { @@ -4000,7 +4000,7 @@ SvNFEngine::Accessor SvNFEngine::GetROPolicy(const SvNFFormatData& rFormatData, } sal_uInt32 SvNFEngine::GetFormatForLanguageIfBuiltIn(SvNFLanguageData& rCurrentLanguage, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, const Accessor& rFuncs, sal_uInt32 nFormat, LanguageType eLnge) { @@ -4009,7 +4009,7 @@ sal_uInt32 SvNFEngine::GetFormatForLanguageIfBuiltIn(SvNFLanguageData& rCurrentL if (IsFormatSimpleBuiltIn(rCurrentLanguage, nFormat, eLnge)) return nFormat; - sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, pNatNum, eLnge); + sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, rNatNum, eLnge); sal_uInt32 nOffset = nFormat % SV_COUNTRY_LANGUAGE_OFFSET; // relative index return nCLOffset + nOffset; } @@ -4027,12 +4027,12 @@ LanguageType SvNFLanguageData::ImpResolveLanguage(LanguageType eLnge) const } sal_uInt32 SvNFEngine::GetFormatIndex(SvNFLanguageData& rCurrentLanguage, const Accessor& rFuncs, - const NativeNumberWrapper* pNatNum, NfIndexTableOffset nTabOff, + const NativeNumberWrapper& rNatNum, NfIndexTableOffset nTabOff, LanguageType eLnge) { eLnge = rCurrentLanguage.ImpResolveLanguage(eLnge); - sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, pNatNum, eLnge); // create new standard formats if necessary (and allowed) + sal_uInt32 nCLOffset = rFuncs.mGetCLOffset(rCurrentLanguage, rNatNum, eLnge); // create new standard formats if necessary (and allowed) return ImpGetFormatIndex(nTabOff, nCLOffset); } @@ -4254,7 +4254,7 @@ void SvNumberFormatter::InvalidateDateAcceptancePatterns() } sal_uInt32 SvNFFormatData::ImpGetDefaultSystemCurrencyFormat(SvNFLanguageData& rCurrentLanguage, - const NativeNumberWrapper* pNatNum) + const NativeNumberWrapper& rNatNum) { if ( nDefaultSystemCurrencyFormat == NUMBERFORMAT_ENTRY_NOT_FOUND ) { @@ -4266,7 +4266,7 @@ sal_uInt32 SvNFFormatData::ImpGetDefaultSystemCurrencyFormat(SvNFLanguageData& r DBG_ASSERT( aCurrList.size(), "where is the NewCurrency System standard format?!?" ); // if already loaded or user defined nDefaultSystemCurrencyFormat // will be set to the right value - PutEntry(rCurrentLanguage, pNatNum, aCurrList[ nDefault ], nCheck, nType, + PutEntry(rCurrentLanguage, rNatNum, aCurrList[ nDefault ], nCheck, nType, nDefaultSystemCurrencyFormat, LANGUAGE_SYSTEM ); DBG_ASSERT( nCheck == 0, "NewCurrency CheckError" ); DBG_ASSERT( nDefaultSystemCurrencyFormat != NUMBERFORMAT_ENTRY_NOT_FOUND, @@ -4275,7 +4275,7 @@ sal_uInt32 SvNFFormatData::ImpGetDefaultSystemCurrencyFormat(SvNFLanguageData& r return nDefaultSystemCurrencyFormat; } -sal_uInt32 SvNFFormatData::ImpGetDefaultCurrencyFormat(SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper* pNatNum, +sal_uInt32 SvNFFormatData::ImpGetDefaultCurrencyFormat(SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper& rNatNum, sal_uInt32 CLOffset, LanguageType eLnge) { DefaultFormatKeysMap::const_iterator it = aDefaultFormatKeys.find( CLOffset + ZF_STANDARD_CURRENCY ); @@ -4310,7 +4310,7 @@ sal_uInt32 SvNFFormatData::ImpGetDefaultCurrencyFormat(SvNFLanguageData& rCurren // if already loaded or user defined nDefaultSystemCurrencyFormat // will be set to the right value SvNumFormatType nType; - PutEntry(rCurrentLanguage, pNatNum, aCurrList[ nDefault ], nCheck, nType, + PutEntry(rCurrentLanguage, rNatNum, aCurrList[ nDefault ], nCheck, nType, nDefaultCurrencyFormat, eLnge ); DBG_ASSERT( nCheck == 0, "NewCurrency CheckError" ); DBG_ASSERT( nDefaultCurrencyFormat != NUMBERFORMAT_ENTRY_NOT_FOUND, diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 951c61ec04e1..6167878fccf9 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -751,7 +751,7 @@ static bool lcl_isNatNum12Currency( std::u16string_view sParam ) SvNumberformat::SvNumberformat(OUString& rString, ImpSvNumberformatScan* pSc, ImpSvNumberInputScan* pISc, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, sal_Int32& nCheckPos, LanguageType& eLan, bool bReplaceBooleanEquivalent) @@ -845,7 +845,7 @@ SvNumberformat::SvNumberformat(OUString& rString, { sal_Int32 nDecPos; SvNumFormatType F_Type = SvNumFormatType::UNDEFINED; - if (!pISc->IsNumberFormat(sStr, F_Type, fNumber, nullptr, pNatNum, SvNumInputOptions::NONE) || + if (!pISc->IsNumberFormat(sStr, F_Type, fNumber, nullptr, rNatNum, SvNumInputOptions::NONE) || ( F_Type != SvNumFormatType::NUMBER && F_Type != SvNumFormatType::SCIENTIFIC) ) { @@ -2052,15 +2052,15 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr ) } void SvNumberformat::ImpGetOutputStandard(double& fNumber, OUStringBuffer& rOutString, - const NativeNumberWrapper* pNatNum) const + const NativeNumberWrapper& rNatNum) const { OUString sTemp; - ImpGetOutputStandard(fNumber, sTemp, pNatNum); + ImpGetOutputStandard(fNumber, sTemp, rNatNum); rOutString = sTemp; } void SvNumberformat::ImpGetOutputStandard(double& fNumber, OUString& rOutString, - const NativeNumberWrapper* pNatNum) const + const NativeNumberWrapper& rNatNum) const { sal_uInt16 nStandardPrec = rScan.GetStandardPrec(); @@ -2073,7 +2073,7 @@ void SvNumberformat::ImpGetOutputStandard(double& fNumber, OUString& rOutString, } else { - ImpGetOutputStdToPrecision(fNumber, rOutString, nStandardPrec, pNatNum); + ImpGetOutputStdToPrecision(fNumber, rOutString, nStandardPrec, rNatNum); } } @@ -2098,39 +2098,39 @@ bool checkForAll0s(const T& rString, sal_Int32 nIdx=0) OUString impTransliterateImpl(const OUString& rStr, const SvNumberNatNum& rNum, - const NativeNumberWrapper* pNatNum) + const NativeNumberWrapper& rNatNum) { css::lang::Locale aLocale( LanguageTag( rNum.GetLang() ).getLocale() ); - return pNatNum->getNativeNumberStringParams(rStr, aLocale, rNum.GetNatNum(), rNum.GetParams()); + return rNatNum.getNativeNumberStringParams(rStr, aLocale, rNum.GetNatNum(), rNum.GetParams()); } void impTransliterateImpl(OUStringBuffer& rStr, const SvNumberNatNum& rNum, - const NativeNumberWrapper* pNatNum) + const NativeNumberWrapper& rNatNum) { css::lang::Locale aLocale( LanguageTag( rNum.GetLang() ).getLocale() ); - rStr = pNatNum->getNativeNumberStringParams( + rStr = rNatNum.getNativeNumberStringParams( OUString::unacquired(rStr), aLocale, rNum.GetNatNum(), rNum.GetParams()); } -OUString impTransliterate(const OUString& rStr, const SvNumberNatNum& rNum, const NativeNumberWrapper* pNatNum) +OUString impTransliterate(const OUString& rStr, const SvNumberNatNum& rNum, const NativeNumberWrapper& rNatNum) { - return rNum.IsComplete() ? impTransliterateImpl(rStr, rNum, pNatNum) : rStr; + return rNum.IsComplete() ? impTransliterateImpl(rStr, rNum, rNatNum) : rStr; } -void impTransliterate(OUStringBuffer& rStr, const SvNumberNatNum& rNum, const NativeNumberWrapper* pNatNum) +void impTransliterate(OUStringBuffer& rStr, const SvNumberNatNum& rNum, const NativeNumberWrapper& rNatNum) { if(rNum.IsComplete()) { - impTransliterateImpl(rStr, rNum, pNatNum); + impTransliterateImpl(rStr, rNum, rNatNum); } } } void SvNumberformat::ImpGetOutputStdToPrecision(double& rNumber, OUString& rOutString, sal_uInt16 nPrecision, - const NativeNumberWrapper* pNatNum) const + const NativeNumberWrapper& rNatNum) const { // Make sure the precision doesn't go over the maximum allowable precision. nPrecision = ::std::min(UPPER_PRECISION, nPrecision); @@ -2147,7 +2147,7 @@ void SvNumberformat::ImpGetOutputStdToPrecision(double& rNumber, OUString& rOutS { rOutString = comphelper::string::stripStart(rOutString, '-'); // not -0 } - rOutString = ::impTransliterate(rOutString, NumFor[0].GetNatNum(), pNatNum); + rOutString = ::impTransliterate(rOutString, NumFor[0].GetNatNum(), rNatNum); } void SvNumberformat::ImpGetOutputInputLine(double fNumber, OUString& OutString) const @@ -2435,7 +2435,7 @@ OUString SvNumberformat::GetIntegerFractionDelimiterString( sal_uInt16 nNumFor ) return lcl_GetIntegerFractionDelimiterString( rInfo, nCnt ); } -bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 nCharCount, OUString& rOutString, const NativeNumberWrapper* pNatNum) const +bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 nCharCount, OUString& rOutString, const NativeNumberWrapper& rNatNum) const { if (eType != SvNumFormatType::NUMBER) { @@ -2474,7 +2474,7 @@ bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 nCharCount, OUSt // Subtract the decimal point. --nPrec; } - ImpGetOutputStdToPrecision(fNumber, rOutString, nPrec, pNatNum); + ImpGetOutputStdToPrecision(fNumber, rOutString, nPrec, rNatNum); if (rOutString.getLength() > nCharCount) { // String still wider than desired. Switch to scientific notation. @@ -2511,7 +2511,7 @@ sal_uInt16 SvNumberformat::GetSubformatIndex (double fNumber ) const bool SvNumberformat::GetOutputString(double fNumber, OUString& OutString, const Color** ppColor, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, const SvNFLanguageData& rCurrentLang, bool bStarFlag) const { @@ -2533,7 +2533,7 @@ bool SvNumberformat::GetOutputString(double fNumber, OUStringBuffer sBuff(64); if (eType & SvNumFormatType::TEXT) { - ImpGetOutputStandard(fNumber, sBuff, pNatNum); + ImpGetOutputStandard(fNumber, sBuff, rNatNum); OutString = sBuff.makeStringAndClear(); return false; } @@ -2597,19 +2597,19 @@ bool SvNumberformat::GetOutputString(double fNumber, } return false; } - ImpGetOutputStandard(fNumber, sBuff, pNatNum); + ImpGetOutputStandard(fNumber, sBuff, rNatNum); bHadStandard = true; break; case SvNumFormatType::DATE: - bRes |= ImpGetDateOutput(fNumber, 0, bStarFlag, pNatNum, rCurrentLang, sBuff); + bRes |= ImpGetDateOutput(fNumber, 0, bStarFlag, rNatNum, rCurrentLang, sBuff); bHadStandard = true; break; case SvNumFormatType::TIME: - bRes |= ImpGetTimeOutput(fNumber, 0, bStarFlag, pNatNum, rCurrentLang, sBuff); + bRes |= ImpGetTimeOutput(fNumber, 0, bStarFlag, rNatNum, rCurrentLang, sBuff); bHadStandard = true; break; case SvNumFormatType::DATETIME: - bRes |= ImpGetDateTimeOutput(fNumber, 0, bStarFlag, pNatNum, rCurrentLang, sBuff); + bRes |= ImpGetDateTimeOutput(fNumber, 0, bStarFlag, rNatNum, rCurrentLang, sBuff); bHadStandard = true; break; default: break; @@ -2633,7 +2633,7 @@ bool SvNumberformat::GetOutputString(double fNumber, } else if (nCnt == 0) // Else Standard Format { - ImpGetOutputStandard(fNumber, sBuff, pNatNum); + ImpGetOutputStandard(fNumber, sBuff, rNatNum); OutString = sBuff.makeStringAndClear(); return false; } @@ -2671,27 +2671,27 @@ bool SvNumberformat::GetOutputString(double fNumber, } break; case SvNumFormatType::DATE: - bRes |= ImpGetDateOutput(fNumber, nIx, bStarFlag, pNatNum, rCurrentLang, sBuff); + bRes |= ImpGetDateOutput(fNumber, nIx, bStarFlag, rNatNum, rCurrentLang, sBuff); break; case SvNumFormatType::TIME: - bRes |= ImpGetTimeOutput(fNumber, nIx, bStarFlag, pNatNum, rCurrentLang, sBuff); + bRes |= ImpGetTimeOutput(fNumber, nIx, bStarFlag, rNatNum, rCurrentLang, sBuff); break; case SvNumFormatType::DATETIME: - bRes |= ImpGetDateTimeOutput(fNumber, nIx, bStarFlag, pNatNum, rCurrentLang, sBuff); + bRes |= ImpGetDateTimeOutput(fNumber, nIx, bStarFlag, rNatNum, rCurrentLang, sBuff); break; case SvNumFormatType::NUMBER: case SvNumFormatType::PERCENT: case SvNumFormatType::CURRENCY: - bRes |= ImpGetNumberOutput(fNumber, nIx, bStarFlag, pNatNum, sBuff); + bRes |= ImpGetNumberOutput(fNumber, nIx, bStarFlag, rNatNum, sBuff); break; case SvNumFormatType::LOGICAL: - bRes |= ImpGetLogicalOutput(fNumber, nIx, pNatNum, sBuff); + bRes |= ImpGetLogicalOutput(fNumber, nIx, rNatNum, sBuff); break; case SvNumFormatType::FRACTION: - bRes |= ImpGetFractionOutput(fNumber, nIx, bStarFlag, pNatNum, sBuff); + bRes |= ImpGetFractionOutput(fNumber, nIx, bStarFlag, rNatNum, sBuff); break; case SvNumFormatType::SCIENTIFIC: - bRes |= ImpGetScientificOutput(fNumber, nIx, bStarFlag, pNatNum, sBuff); + bRes |= ImpGetScientificOutput(fNumber, nIx, bStarFlag, rNatNum, sBuff); break; default: break; } @@ -2703,7 +2703,7 @@ bool SvNumberformat::GetOutputString(double fNumber, bool SvNumberformat::ImpGetScientificOutput(double fNumber, sal_uInt16 nIx, bool bStarFlag, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, OUStringBuffer& sStr) const { bool bRes = false; @@ -2807,7 +2807,7 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber, } // restore leading zeros or blanks according to format '0' or '?' tdf#156449 - bRes |= ImpNumberFill(pNatNum, ExpStr, fNumber, k, j, nIx, NF_SYMBOLTYPE_EXP, bStarFlag); + bRes |= ImpNumberFill(rNatNum, ExpStr, fNumber, k, j, nIx, NF_SYMBOLTYPE_EXP, bStarFlag); bool bCont = true; @@ -2839,7 +2839,7 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber, } else { - bRes |= ImpDecimalFill(pNatNum, sStr, fNumber, nDecPos, j, nIx, false, bStarFlag); + bRes |= ImpDecimalFill(rNatNum, sStr, fNumber, nDecPos, j, nIx, false, bStarFlag); } if (bSign) @@ -2938,7 +2938,7 @@ void SvNumberformat::ImpGetFractionElements ( double& fNumber, sal_uInt16 nIx, bool SvNumberformat::ImpGetFractionOutput(double fNumber, sal_uInt16 nIx, bool bStarFlag, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, OUStringBuffer& sBuff) const { bool bRes = false; @@ -2986,7 +2986,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, char aBuf[100]; o3tl::sprintf( aBuf, "%.f", fNum ); // simple rounded integer sStr.appendAscii( aBuf ); - ::impTransliterate(sStr, NumFor[nIx].GetNatNum(), pNatNum); + ::impTransliterate(sStr, NumFor[nIx].GetNatNum(), rNatNum); } bool bHideFraction = (rInfo.nCntPre > 0 && nFrac == 0 && (sNumeratorFormat.indexOf('0') < 0) @@ -2998,14 +2998,14 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, } else // if there are some '0' in format, force display of fraction { - sFrac = ImpIntToString(pNatNum, nIx, nFrac); - sDiv = ImpIntToString(pNatNum, nIx, nDiv); + sFrac = ImpIntToString(rNatNum, nIx, nFrac); + sDiv = ImpIntToString(rNatNum, nIx, nDiv); } sal_uInt16 j = nCnt-1; // Last symbol -> backwards sal_Int32 k; // Denominator - bRes |= ImpNumberFill(pNatNum, sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC, bStarFlag, true); + bRes |= ImpNumberFill(rNatNum, sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC, bStarFlag, true); bool bCont = true; if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_FRAC) @@ -3036,7 +3036,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, } else { - bRes |= ImpNumberFill(pNatNum, sFrac, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRACBLANK, bStarFlag); + bRes |= ImpNumberFill(rNatNum, sFrac, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRACBLANK, bStarFlag); bCont = false; // there is no integer part? if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_FRACBLANK) { @@ -3081,7 +3081,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, else { k = sStr.getLength(); // After last figure - bRes |= ImpNumberFillWithThousands(pNatNum, sStr, fNumber, k, j, nIx, + bRes |= ImpNumberFillWithThousands(rNatNum, sStr, fNumber, k, j, nIx, rInfo.nCntPre, bStarFlag); } if (bSign && (nFrac != 0 || fNum != 0.0)) @@ -3096,7 +3096,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, sal_uInt16 SvNumberformat::ImpGetFractionOfSecondString( OUStringBuffer& rBuf, double fFractionOfSecond, int nFractionDecimals, bool bAddOneRoundingDecimal, sal_uInt16 nIx, sal_uInt16 nMinimumInputLineDecimals, - const NativeNumberWrapper* pNatNum) const + const NativeNumberWrapper& rNatNum) const { if (!nFractionDecimals) return 0; @@ -3116,12 +3116,12 @@ sal_uInt16 SvNumberformat::ImpGetFractionOfSecondString( OUStringBuffer& rBuf, d { rBuf.append('0'); } - ::impTransliterate(rBuf, NumFor[nIx].GetNatNum(), pNatNum); + ::impTransliterate(rBuf, NumFor[nIx].GetNatNum(), rNatNum); nFractionDecimals = rBuf.getLength(); } else { - ::impTransliterate(rBuf, NumFor[nIx].GetNatNum(), pNatNum); + ::impTransliterate(rBuf, NumFor[nIx].GetNatNum(), rNatNum); } return static_cast<sal_uInt16>(nFractionDecimals); } @@ -3129,7 +3129,7 @@ sal_uInt16 SvNumberformat::ImpGetFractionOfSecondString( OUStringBuffer& rBuf, d bool SvNumberformat::ImpGetTimeOutput(double fNumber, sal_uInt16 nIx, bool bStarFlag, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, const SvNFLanguageData& rCurrentLang, OUStringBuffer& sBuff) const { @@ -3173,7 +3173,7 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber, nMin = nCMinute; nSec = nCSecond; nCntPost = ImpGetFractionOfSecondString( sSecStr, fFractionOfSecond, nCntPost, true, nIx, - (bInputLine ? rInfo.nCntPost : 0), pNatNum ); + (bInputLine ? rInfo.nCntPost : 0), rNatNum ); } else { @@ -3190,7 +3190,7 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber, sal_uInt32 nSeconds = static_cast<sal_uInt32>(fTime); nCntPost = ImpGetFractionOfSecondString( sSecStr, fTime - nSeconds, nCntPost, false, nIx, - (bInputLine ? rInfo.nCntPost : 0), pNatNum ); + (bInputLine ? rInfo.nCntPost : 0), rNatNum ); if (rInfo.nThousand == 3) // [ss] { @@ -3307,22 +3307,22 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber, } break; case NF_KEY_MI: // M - sBuff.append(ImpIntToString(pNatNum, nIx, nMin )); + sBuff.append(ImpIntToString(rNatNum, nIx, nMin )); break; case NF_KEY_MMI: // MM - sBuff.append(ImpIntToString(pNatNum, nIx, nMin, 2 )); + sBuff.append(ImpIntToString(rNatNum, nIx, nMin, 2 )); break; case NF_KEY_H: // H - sBuff.append(ImpIntToString(pNatNum, nIx, nHour )); + sBuff.append(ImpIntToString(rNatNum, nIx, nHour )); break; case NF_KEY_HH: // HH - sBuff.append(ImpIntToString(pNatNum, nIx, nHour, 2 )); + sBuff.append(ImpIntToString(rNatNum, nIx, nHour, 2 )); break; case NF_KEY_S: // S - sBuff.append(ImpIntToString(pNatNum, nIx, nSec )); + sBuff.append(ImpIntToString(rNatNum, nIx, nSec )); break; case NF_KEY_SS: // SS - sBuff.append(ImpIntToString(pNatNum, nIx, nSec, 2 )); + sBuff.append(ImpIntToString(rNatNum, nIx, nSec, 2 )); break; default: break; @@ -3758,7 +3758,7 @@ static bool lcl_getValidDate( const DateTime& rNullDate, const DateTime& rEpochS bool SvNumberformat::ImpGetDateOutput(double fNumber, sal_uInt16 nIx, bool bStarFlag, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, const SvNFLanguageData& rCurrentLang, OUStringBuffer& sBuff) const { @@ -3845,7 +3845,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber, // for example, Catalan "de març", but "d'abril" etc. if ( bUseSpellout ) { - aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], pNatNum); + aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], rNatNum); } sBuff.append(aStr); break; @@ -3866,7 +3866,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber, nNatNum); if ( bUseSpellout ) { - aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], pNatNum); + aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], rNatNum); } sBuff.append(aStr); break; @@ -3881,7 +3881,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber, // NatNum12: support variants of preposition, suffixation or article if ( bUseSpellout ) { - aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], pNatNum); + aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], rNatNum); } sBuff.append(aStr); break; @@ -3897,7 +3897,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber, // NatNum12: support at least capitalize, upper, lower, title if ( bUseSpellout ) { - aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], pNatNum); + aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], rNatNum); } sBuff.append(aStr); if ( bOtherCalendar ) @@ -3914,7 +3914,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber, // NatNum12: support variants of preposition, suffixation or article if ( bUseSpellout ) { - aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], pNatNum); + aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], rNatNum); } sBuff.append(aStr); if ( bOtherCalendar ) @@ -3957,14 +3957,14 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber, // without suddenly being hit by the 2-digit year magic. OUStringBuffer aBuf; padToLength(aBuf, 4 - aStr.getLength(), '0'); - ::impTransliterate(aBuf, NumFor[nIx].GetNatNum(), pNatNum); + ::impTransliterate(aBuf, NumFor[nIx].GetNatNum(), rNatNum); aBuf.append(aStr); aStr = aBuf.makeStringAndClear(); } // NatNum12: support variants of preposition, suffixation or article if ( bUseSpellout ) { - aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], pNatNum); + aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], rNatNum); } sBuff.append(aStr); if ( bOtherCalendar ) @@ -3985,7 +3985,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber, // NatNum12: support at least capitalize, upper, lower, title if ( bUseSpellout ) { - aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], pNatNum); + aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], rNatNum); } sBuff.append(aStr); break; @@ -3995,7 +3995,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber, // NatNum12: support variants of preposition, suffixation or article if ( bUseSpellout ) { - aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], pNatNum); + aStr = impTransliterate(aStr, NumFor[nIx].GetNatNum(), rInfo.nTypeArray[i], rNatNum); } sBuff.append(aStr); break; @@ -4004,7 +4004,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber, sBuff.append(rLoc().getLongDateDayOfWeekSep()); break; case NF_KEY_WW : // WW - sBuff.append(ImpIntToString(pNatNum, nIx, + sBuff.append(ImpIntToString(rNatNum, nIx, rCal.getValue( CalendarFieldIndex::WEEK_OF_YEAR ))); break; case NF_KEY_G: // G @@ -4031,7 +4031,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber, bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, sal_uInt16 nIx, bool bStarFlag, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, const SvNFLanguageData& rCurrentLang, OUStringBuffer& sBuff) const { @@ -4097,14 +4097,14 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, nMin = nCMinute; nSec = nCSecond; nCntPost = ImpGetFractionOfSecondString( sSecStr, fFractionOfSecond, nCntPost, true, nIx, - (bInputLine ? rInfo.nCntPost : 0), pNatNum ); + (bInputLine ? rInfo.nCntPost : 0), rNatNum ); } else { sal_uInt32 nSeconds = static_cast<sal_uInt32>(floor( fTime )); nCntPost = ImpGetFractionOfSecondString( sSecStr, fTime - nSeconds, nCntPost, false, nIx, - (bInputLine ? rInfo.nCntPost : 0), pNatNum ); + (bInputLine ? rInfo.nCntPost : 0), rNatNum ); if (rInfo.nThousand == 3) // [ss] { @@ -4220,22 +4220,22 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, } break; case NF_KEY_MI: // M - sBuff.append(ImpIntToString(pNatNum, nIx, nMin )); + sBuff.append(ImpIntToString(rNatNum, nIx, nMin )); break; case NF_KEY_MMI: // MM - sBuff.append(ImpIntToString(pNatNum, nIx, nMin, 2 )); + sBuff.append(ImpIntToString(rNatNum, nIx, nMin, 2 )); break; case NF_KEY_H: // H - sBuff.append(ImpIntToString(pNatNum, nIx, nHour )); + sBuff.append(ImpIntToString(rNatNum, nIx, nHour )); break; case NF_KEY_HH: // HH - sBuff.append(ImpIntToString(pNatNum, nIx, nHour, 2 )); + sBuff.append(ImpIntToString(rNatNum, nIx, nHour, 2 )); break; case NF_KEY_S: // S - sBuff.append(ImpIntToString(pNatNum, nIx, nSec )); + sBuff.append(ImpIntToString(rNatNum, nIx, nSec )); break; case NF_KEY_SS: // SS - sBuff.append(ImpIntToString(pNatNum, nIx, nSec, 2 )); + sBuff.append(ImpIntToString(rNatNum, nIx, nSec, 2 )); break; case NF_KEY_M: // M sBuff.append(rCal.getDisplayString( @@ -4329,7 +4329,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, // without suddenly being hit by the 2-digit year magic. OUStringBuffer aBuf; padToLength(aBuf, 4 - aYear.getLength(), '0'); - ::impTransliterate(aBuf, NumFor[nIx].GetNatNum(), pNatNum); + ::impTransliterate(aBuf, NumFor[nIx].GetNatNum(), rNatNum); aBuf.append(aYear); sBuff.append(aBuf); } @@ -4362,7 +4362,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, sBuff.append(rLoc().getLongDateDayOfWeekSep()); break; case NF_KEY_WW : // WW - sBuff.append(ImpIntToString(pNatNum, nIx, rCal.getValue( CalendarFieldIndex::WEEK_OF_YEAR ))); + sBuff.append(ImpIntToString(rNatNum, nIx, rCal.getValue( CalendarFieldIndex::WEEK_OF_YEAR ))); break; case NF_KEY_G: // G ImpAppendEraG( sBuff, rCal, nNatNum ); @@ -4387,7 +4387,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, bool SvNumberformat::ImpGetLogicalOutput(double fNumber, sal_uInt16 nIx, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, OUStringBuffer& sStr) const { bool bRes = false; @@ -4405,14 +4405,14 @@ bool SvNumberformat::ImpGetLogicalOutput(double fNumber, break; } } - ::impTransliterate(sStr, NumFor[nIx].GetNatNum(), pNatNum); + ::impTransliterate(sStr, NumFor[nIx].GetNatNum(), rNatNum); return bRes; } bool SvNumberformat::ImpGetNumberOutput(double fNumber, sal_uInt16 nIx, bool bStarFlag, - const NativeNumberWrapper* pNatNum, + const NativeNumberWrapper& rNatNum, OUStringBuffer& sStr) const { bool bRes = false; @@ -4519,16 +4519,16 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber, // Edit backwards: j = NumFor[nIx].GetCount()-1; // Last symbol // Decimal places: - bRes |= ImpDecimalFill(pNatNum, sStr, fNumber, nDecPos, j, nIx, bInteger, bStarFlag); + bRes |= ImpDecimalFill(rNatNum, sStr, fNumber, nDecPos, j, nIx, bInteger, bStarFlag); if (bSign) { sStr.insert(0, '-'); } - ::impTransliterate(sStr, NumFor[nIx].GetNatNum(), pNatNum); + ::impTransliterate(sStr, NumFor[nIx].GetNatNum(), rNatNum); return bRes; } -bool SvNumberformat::ImpDecimalFill(const NativeNumberWrapper* pNatNum, +bool SvNumberformat::ImpDecimalFill(const NativeNumberWrapper& rNatNum, OUStringBuffer& sStr, // number string double& rNumber, // number sal_Int32 nDecPos, // decimals start @@ -4633,7 +4633,7 @@ bool SvNumberformat::ImpDecimalFill(const NativeNumberWrapper* pNatNum, case NF_KEY_GENERAL: // Standard in the String { OUStringBuffer sNum; - ImpGetOutputStandard(rNumber, sNum, pNatNum); + ImpGetOutputStandard(rNumber, sNum, rNatNum); sNum.stripStart('-'); sStr.insert(k, sNum); break; @@ -4645,13 +4645,13 @@ bool SvNumberformat::ImpDecimalFill(const NativeNumberWrapper* pNatNum, } // of while } // of decimal places - bRes |= ImpNumberFillWithThousands(pNatNum, sStr, rNumber, k, j, nIx, // Fill with . if needed + bRes |= ImpNumberFillWithThousands(rNatNum, sStr, rNumber, k, j, nIx, // Fill with . if needed rInfo.nCntPre, bStarFlag, bFilled ); return bRes; } -bool SvNumberformat::ImpNumberFillWithThousands( const NativeNumberWrapper* pNatNum, +bool SvNumberformat::ImpNumberFillWithThousands( const NativeNumberWrapper& rNatNum, OUStringBuffer& sBuff, // number string double& rNumber, // number sal_Int32 k, // position within string @@ -4795,7 +4795,7 @@ bool SvNumberformat::ImpNumberFillWithThousands( const NativeNumberWrapper* pNat case NF_KEY_GENERAL: // "General" in string { OUStringBuffer sNum; - ImpGetOutputStandard(rNumber, sNum, pNatNum); + ImpGetOutputStandard(rNumber, sNum, rNatNum); sNum.stripStart('-'); sBuff.insert(k, sNum); break; @@ -4841,7 +4841,7 @@ void SvNumberformat::ImpDigitFill(OUStringBuffer& sStr, // number string } } -bool SvNumberformat::ImpNumberFill( const NativeNumberWrapper* pNatNum, +bool SvNumberformat::ImpNumberFill( const NativeNumberWrapper& rNatNum, OUStringBuffer& sBuff, // number string double& rNumber, // number for "General" format sal_Int32& k, // position within string @@ -4933,7 +4933,7 @@ bool SvNumberformat::ImpNumberFill( const NativeNumberWrapper* pNatNum, { OUStringBuffer sNum; bFoundNumber = true; - ImpGetOutputStandard(rNumber, sNum, pNatNum); + ImpGetOutputStandard(rNumber, sNum, rNatNum); sNum.stripStart('-'); sBuff.insert(k, sNum); } @@ -5688,7 +5688,7 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, // static OUString SvNumberformat::ImpGetNatNumString(const SvNumberNatNum& rNum, sal_Int64 nVal, sal_uInt16 nMinDigits, - const NativeNumberWrapper* pNatNum) + const NativeNumberWrapper& rNatNum) { OUString aStr; if ( nMinDigits ) @@ -5731,17 +5731,17 @@ OUString SvNumberformat::ImpGetNatNumString(const SvNumberNatNum& rNum, { aStr = OUString::number( nVal ); } - return ::impTransliterate(aStr, rNum, pNatNum); + return ::impTransliterate(aStr, rNum, rNatNum); } OUString SvNumberformat::impTransliterateImpl(const OUString& rStr, const SvNumberNatNum& rNum, const sal_uInt16 nDateKey, - const NativeNumberWrapper* pNatNum) const + const NativeNumberWrapper& rNatNum) const { // no KEYWORD=argument list in NatNum12 if (rNum.GetParams().indexOf('=') == -1) - return ::impTransliterateImpl( rStr, rNum, pNatNum); + return ::impTransliterateImpl( rStr, rNum, rNatNum); const NfKeywordTable & rKeywords = rScan.GetKeywords(); @@ -5768,13 +5768,13 @@ OUString SvNumberformat::impTransliterateImpl(const OUString& rStr, css::lang::Locale aLocale( LanguageTag( rNum.GetLang() ).getLocale() ); - return pNatNum->getNativeNumberStringParams( + return rNatNum.getNativeNumberStringParams( rStr, aLocale, rNum.GetNatNum(), rNum.GetParams().copy(nField + nKeywordLen, nFieldEnd - nField - nKeywordLen)); } void SvNumberformat::GetNatNumXml( css::i18n::NativeNumberXmlAttributes2& rAttr, - sal_uInt16 nNumFor, const NativeNumberWrapper* pNatNum ) const + sal_uInt16 nNumFor, const NativeNumberWrapper& rNatNum ) const { if ( nNumFor <= 3 ) { @@ -5789,7 +5789,7 @@ void SvNumberformat::GetNatNumXml( css::i18n::NativeNumberXmlAttributes2& rAttr, * adapted, and whether to fill Spellout or something different * should be internal there. */ css::i18n::NativeNumberXmlAttributes aTmp( - pNatNum->convertToXmlAttributes( + rNatNum.convertToXmlAttributes( aLocale, rNum.GetNatNum())); rAttr.Locale = aTmp.Locale; rAttr.Format = aTmp.Format; |