summaryrefslogtreecommitdiff
path: root/svl/source
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-06-08 17:43:13 +0200
committerEike Rathke <erack@redhat.com>2022-06-08 20:15:19 +0200
commit2932dc7aa0c1239d39e060e6b7627317f1305549 (patch)
treec8f47ba136795f9401ffde5c731689aae0a5153b /svl/source
parent98cfc7db5ed352b2ddb9a547c7f88abb83264cef (diff)
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
Diffstat (limited to 'svl/source')
-rw-r--r--svl/source/numbers/zformat.cxx28
1 files changed, 27 insertions, 1 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index dd5b9fe00429..a4756f4982b1 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)