include/svl/zformat.hxx | 3 +++ svl/source/numbers/zformat.cxx | 21 ++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-)
New commits: commit 96c65c2491c0e767823a972df85d2ee873cc8c65 Author: Caolán McNamara <[email protected]> AuthorDate: Tue Feb 17 09:34:32 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Feb 21 03:35:12 2026 +0100 bubble the provided SvNFLanguageData through more helpers Change-Id: I88d10099f68f063eb26c8754eecee9072beece11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199835 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index 1ebacf39cec3..0e9bcfc8190c 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -696,11 +696,13 @@ private: sal_uInt16 nIx, bool bStarFlag, const NativeNumberWrapper& rNatNum, + const SvNFLanguageData& rCurrentLang, OUStringBuffer& OutString) const; SVL_DLLPRIVATE bool ImpGetScientificOutput(double fNumber, sal_uInt16 nIx, bool bStarFlag, const NativeNumberWrapper& rNatNum, + const SvNFLanguageData& rCurrentLang, OUStringBuffer& OutString) const; SVL_DLLPRIVATE bool ImpGetDateOutput( double fNumber, @@ -747,6 +749,7 @@ private: sal_uInt16 nIx, bool bStarFlag, const NativeNumberWrapper& rNatNum, + const SvNFLanguageData& rCurrentLang, OUStringBuffer& OutString) const; SVL_DLLPRIVATE void ImpCopyNumberformat( const SvNumberformat& rFormat ); diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 3b587ffc5a98..6ae372d51978 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2673,16 +2673,16 @@ bool SvNumberformat::GetOutputString(double fNumber, case SvNumFormatType::NUMBER: case SvNumFormatType::PERCENT: case SvNumFormatType::CURRENCY: - bRes |= ImpGetNumberOutput(fNumber, nIx, bStarFlag, rNatNum, sBuff); + bRes |= ImpGetNumberOutput(fNumber, nIx, bStarFlag, rNatNum, rCurrentLang, sBuff); break; case SvNumFormatType::LOGICAL: bRes |= ImpGetLogicalOutput(fNumber, nIx, rNatNum, rCurrentLang, sBuff); break; case SvNumFormatType::FRACTION: - bRes |= ImpGetFractionOutput(fNumber, nIx, bStarFlag, rNatNum, sBuff); + bRes |= ImpGetFractionOutput(fNumber, nIx, bStarFlag, rNatNum, rCurrentLang, sBuff); break; case SvNumFormatType::SCIENTIFIC: - bRes |= ImpGetScientificOutput(fNumber, nIx, bStarFlag, rNatNum, sBuff); + bRes |= ImpGetScientificOutput(fNumber, nIx, bStarFlag, rNatNum, rCurrentLang, sBuff); break; default: break; } @@ -2695,6 +2695,7 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber, sal_uInt16 nIx, bool bStarFlag, const NativeNumberWrapper& rNatNum, + const SvNFLanguageData& rCurrentLang, OUStringBuffer& sStr) const { bool bRes = false; @@ -2798,7 +2799,7 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber, } // restore leading zeros or blanks according to format '0' or '?' tdf#156449 - bRes |= ImpNumberFill(rNatNum, GetCurrentLanguageData(), ExpStr, fNumber, k, j, nIx, NF_SYMBOLTYPE_EXP, bStarFlag); + bRes |= ImpNumberFill(rNatNum, rCurrentLang, ExpStr, fNumber, k, j, nIx, NF_SYMBOLTYPE_EXP, bStarFlag); bool bCont = true; @@ -2830,7 +2831,7 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber, } else { - bRes |= ImpDecimalFill(rNatNum, GetCurrentLanguageData(), sStr, fNumber, nDecPos, j, nIx, false, bStarFlag); + bRes |= ImpDecimalFill(rNatNum, rCurrentLang, sStr, fNumber, nDecPos, j, nIx, false, bStarFlag); } if (bSign) @@ -2930,6 +2931,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, sal_uInt16 nIx, bool bStarFlag, const NativeNumberWrapper& rNatNum, + const SvNFLanguageData& rCurrentLang, OUStringBuffer& sBuff) const { bool bRes = false; @@ -2996,7 +2998,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, sal_uInt16 j = nCnt-1; // Last symbol -> backwards sal_Int32 k; // Denominator - bRes |= ImpNumberFill(rNatNum, GetCurrentLanguageData(), sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC, bStarFlag, true); + bRes |= ImpNumberFill(rNatNum, rCurrentLang, sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC, bStarFlag, true); bool bCont = true; if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_FRAC) @@ -3027,7 +3029,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, } else { - bRes |= ImpNumberFill(rNatNum, GetCurrentLanguageData(), sFrac, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRACBLANK, bStarFlag); + bRes |= ImpNumberFill(rNatNum, rCurrentLang, sFrac, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRACBLANK, bStarFlag); bCont = false; // there is no integer part? if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_FRACBLANK) { @@ -3072,7 +3074,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, else { k = sStr.getLength(); // After last figure - bRes |= ImpNumberFillWithThousands(rNatNum, GetCurrentLanguageData(), sStr, fNumber, k, j, nIx, + bRes |= ImpNumberFillWithThousands(rNatNum, rCurrentLang, sStr, fNumber, k, j, nIx, rInfo.nCntPre, bStarFlag); } if (bSign && (nFrac != 0 || fNum != 0.0)) @@ -4405,6 +4407,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber, sal_uInt16 nIx, bool bStarFlag, const NativeNumberWrapper& rNatNum, + const SvNFLanguageData& rCurrentLang, OUStringBuffer& sStr) const { bool bRes = false; @@ -4511,7 +4514,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber, // Edit backwards: j = NumFor[nIx].GetCount()-1; // Last symbol // Decimal places: - bRes |= ImpDecimalFill(rNatNum, GetCurrentLanguageData(), sStr, fNumber, nDecPos, j, nIx, bInteger, bStarFlag); + bRes |= ImpDecimalFill(rNatNum, rCurrentLang, sStr, fNumber, nDecPos, j, nIx, bInteger, bStarFlag); if (bSign) { sStr.insert(0, '-');
