diff options
author | Laurent Balland-Poirier <laurent.balland-poirier@laposte.net> | 2016-06-04 17:03:32 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-06-16 07:41:59 +0000 |
commit | bd4ef2734b60d2188874178f173c9163ced09ce7 (patch) | |
tree | 504585149a90c575b7eb9fdb186ae134952b9608 /xmloff/source/style/xmlnumfi.cxx | |
parent | dabee9834be560c0b2ca174e88002f0eae1d155a (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>
Diffstat (limited to 'xmloff/source/style/xmlnumfi.cxx')
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index b85bb1312e49..42ef1d457c1e 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -767,14 +767,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 == '%' ) |