summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2016-06-04 17:03:32 +0200
committerEike Rathke <erack@redhat.com>2016-06-16 08:15:06 +0000
commit0330e8cd0ce65c62e61d4b5af5dc1aab3b0db697 (patch)
treef0f314382adc0590b3cf99e5863aa52d3f553587 /xmloff
parent0a19e85f0c34c85f18cc9d5ade9a5ad41ed6750b (diff)
tdf#97837 Detect delimiter only for date, time, currency
Other formats do not require delimiter Except for minus sign Change-Id: Ica5a62c175345062383247760fe5e2a061aeebe8 Reviewed-on: https://gerrit.libreoffice.org/24902 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit bd4ef2734b60d2188874178f173c9163ced09ce7) Reviewed-on: https://gerrit.libreoffice.org/26350
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnumfi.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index ddd925cc4f3f..9ea4e74e5d3d 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -760,14 +760,18 @@ static bool lcl_ValidChar( sal_Unicode cChar, const SvXMLNumFormatContext& rPare
}
// see ImpSvNumberformatScan::Next_Symbol
- if ( cChar == ' ' ||
- cChar == '-' ||
- cChar == '/' ||
- cChar == '.' ||
- cChar == ',' ||
- cChar == ':' ||
- cChar == '\'' )
- return true; // for all format types
+ if ( cChar == '-' )
+ return true; // all format types may content minus sign or delimiter
+ if ( ( cChar == ' ' ||
+ cChar == '/' ||
+ cChar == '.' ||
+ cChar == ',' ||
+ cChar == ':' ||
+ cChar == '\'' ) &&
+ ( nFormatType == XML_TOK_STYLES_CURRENCY_STYLE ||
+ nFormatType == XML_TOK_STYLES_DATE_STYLE ||
+ nFormatType == XML_TOK_STYLES_TIME_STYLE ) ) // other formats do not require delimiter tdf#97837
+ return true;
// percent sign must be used without quotes for percentage styles only
if ( nFormatType == XML_TOK_STYLES_PERCENTAGE_STYLE && cChar == '%' )