Related: tdf#149484 Display BOOLEAN literal string text additions
Change-Id: Ifbaf0b18178091c3a340a7c4bc66f78397aadc18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135506
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index cd04f96..ae57f5c 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -696,6 +696,10 @@ private:
SVL_DLLPRIVATE static void ImpAppendEraG( OUStringBuffer& OutStringBuffer, const CalendarWrapper& rCal,
sal_Int16 nNatNum );
SVL_DLLPRIVATE bool ImpGetLogicalOutput( double fNumber,
sal_uInt16 nIx,
OUStringBuffer& OutString );
SVL_DLLPRIVATE bool ImpGetNumberOutput( double fNumber,
sal_uInt16 nIx,
OUStringBuffer& OutString );
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index dd5b9fe..a4756f4 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2449,7 +2449,7 @@ bool SvNumberformat::GetOutputString(double fNumber,
bool bRes = false;
OutString.clear();
*ppColor = nullptr; // No color change
if (eType & SvNumFormatType::LOGICAL)
if (eType & SvNumFormatType::LOGICAL && sFormatstring == rScan.GetKeywords()[NF_KEY_BOOLEAN])
{
if (fNumber)
{
@@ -2615,6 +2615,9 @@ bool SvNumberformat::GetOutputString(double fNumber,
case SvNumFormatType::CURRENCY:
bRes |= ImpGetNumberOutput(fNumber, nIx, sBuff);
break;
case SvNumFormatType::LOGICAL:
bRes |= ImpGetLogicalOutput(fNumber, nIx, sBuff);
break;
case SvNumFormatType::FRACTION:
bRes |= ImpGetFractionOutput(fNumber, nIx, sBuff);
break;
@@ -4287,6 +4290,29 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
return bRes;
}
bool SvNumberformat::ImpGetLogicalOutput(double fNumber,
sal_uInt16 nIx,
OUStringBuffer& sStr)
{
bool bRes = false;
const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
const sal_uInt16 nCnt = NumFor[nIx].GetCount();
for (sal_uInt16 j = 0; j < nCnt; ++j)
{
switch (rInfo.nTypeArray[j])
{
case NF_KEY_BOOLEAN:
sStr.append( fNumber ? rScan.GetTrueString() : rScan.GetFalseString());
break;
case NF_SYMBOLTYPE_STRING:
sStr.append( rInfo.sStrArray[j]);
break;
}
}
impTransliterate(sStr, NumFor[nIx].GetNatNum());
return bRes;
}
bool SvNumberformat::ImpGetNumberOutput(double fNumber,
sal_uInt16 nIx,
OUStringBuffer& sStr)