summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-06-08 17:49:15 +0200
committerEike Rathke <erack@redhat.com>2022-06-08 20:49:53 +0200
commit33a8c4bd0e8533ab42894280e7e04c13a47aefa9 (patch)
treeb3fb6e3471f4f79b5c0b33ea398661d0a893a0e1 /xmloff
parent755e0cd60d4634111911469b752485da678988e1 (diff)
Related: tdf#149484 Write proper <number:boolean-style> with <number:text>
Change-Id: I46b7987dde25840ae0b6e5871b14e3806c6e4ac8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135508 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnumfe.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 52b286dd50a9..82ed552dcbca 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -1254,6 +1254,37 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
WriteBooleanElement_Impl();
bAnyContent = true;
}
+ else if (eType == XML_BOOLEAN_STYLE)
+ {
+ // <number:boolean-style> may contain only <number:boolean> and
+ // <number:text> elements.
+ sal_uInt16 nPos = 0;
+ bool bEnd = false;
+ while (!bEnd)
+ {
+ const short nElemType = rFormat.GetNumForType( nPart, nPos );
+ switch (nElemType)
+ {
+ case 0:
+ bEnd = true; // end of format reached
+ if (bHasText && sTextContent.isEmpty())
+ bHasText = false; // don't write trailing empty text
+ break;
+ case NF_SYMBOLTYPE_STRING:
+ {
+ const OUString* pElemStr = rFormat.GetNumForString( nPart, nPos );
+ if (pElemStr)
+ AddToTextElement_Impl( *pElemStr );
+ }
+ break;
+ case NF_KEY_BOOLEAN:
+ WriteBooleanElement_Impl();
+ bAnyContent = true;
+ break;
+ }
+ ++nPos;
+ }
+ }
else
{
// first loop to collect attributes