summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
Diffstat (limited to 'svl')
-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)