summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 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 == '%' )