[Libreoffice-commits] core.git: xmloff/source

Laurent Balland-Poirier laurent.balland-poirier at laposte.net
Thu Jun 16 07:42:27 UTC 2016


 xmloff/source/style/xmlnumfi.cxx |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

New commits:
commit bd4ef2734b60d2188874178f173c9163ced09ce7
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Sat Jun 4 17:03:32 2016 +0200

    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 at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index b85bb13..42ef1d4 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 == '%' )


More information about the Libreoffice-commits mailing list