summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorLaurent Balland <laurent.balland@mailo.fr>2023-05-16 09:24:55 +0200
committerEike Rathke <erack@redhat.com>2023-05-26 18:20:26 +0200
commit6dd2ebbba23b20864d3cf74322540c628088375c (patch)
treea9ef5d80497da93f010cc026ea420be2aa1478c9 /xmloff
parent31f2de053d89fc782f98f74785643dbd6e19ba73 (diff)
tdf#150028 Treat decimal separator after [SS]
Only decimal separator after S or SS was treated This change adds [S] and [SS] to treat formats like [SS].00 Update: correct export to XML Add QA unit tests Change-Id: I97ce4084d3caab2fcd18f1c70cd4221596290563 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151823 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnumfe.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index b01c7bd8e597..59e9f7714916 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -1462,11 +1462,13 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
case NF_SYMBOLTYPE_PERCENT:
if (pElemStr)
{
- if ( ( nPrevType == NF_KEY_S || nPrevType == NF_KEY_SS ) &&
- ( nElemType == NF_SYMBOLTYPE_TIME100SECSEP ) &&
+ if ( ( nElemType == NF_SYMBOLTYPE_TIME100SECSEP ) &&
+ ( nPrevType == NF_KEY_S || nPrevType == NF_KEY_SS ||
+ ( nPos > 0 && (*rFormat.GetNumForString( nPart, nPos-1 ))[0] == ']' &&
+ ( nFmtType == SvNumFormatType::TIME || nFmtType == SvNumFormatType::DATETIME ) ) ) &&
nPrecision > 0 )
{
- // decimal separator after seconds is implied by
+ // decimal separator after seconds or [SS] is implied by
// "decimal-places" attribute and must not be written
// as text element
//! difference between '.' and ',' is lost here