cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: r157077 - cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor
Date Fri, 11 Mar 2005 13:32:41 GMT
Author: sylvain
Date: Fri Mar 11 05:32:38 2005
New Revision: 157077

URL: http://svn.apache.org/viewcvs?view=rev&rev=157077
Log:
Fix annoying bug with locales that use space as thousand delimiter

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingDecimalConvertor.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingDoubleConvertor.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingFloatConvertor.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingIntegerConvertor.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingLongConvertor.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingDecimalConvertor.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingDecimalConvertor.java?view=diff&r1=157076&r2=157077
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingDecimalConvertor.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingDecimalConvertor.java
Fri Mar 11 05:32:38 2005
@@ -62,6 +62,8 @@
     }
 
     public ConversionResult convertFromString(String value, Locale locale, Convertor.FormatCache
formatCache) {
+        // Some locales (e.g. "fr") produce non-breaking spaces sent back as space by the
browser
+        value = value.replace(' ', (char)160);
         DecimalFormat decimalFormat = getDecimalFormat(locale, formatCache);
         Number decimalValue;
         try {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingDoubleConvertor.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingDoubleConvertor.java?view=diff&r1=157076&r2=157077
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingDoubleConvertor.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingDoubleConvertor.java
Fri Mar 11 05:32:38 2005
@@ -35,6 +35,8 @@
     }
 
     public ConversionResult convertFromString(String value, Locale locale, Convertor.FormatCache
formatCache) {
+        // Some locales (e.g. "fr") produce non-breaking spaces sent back as space by the
browser
+        value = value.replace(' ', (char)160);
         DecimalFormat decimalFormat = getDecimalFormat(locale, formatCache);
         try {
             Number decimalValue = decimalFormat.parse(value);

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingFloatConvertor.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingFloatConvertor.java?view=diff&r1=157076&r2=157077
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingFloatConvertor.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingFloatConvertor.java
Fri Mar 11 05:32:38 2005
@@ -35,6 +35,8 @@
     }
 
     public ConversionResult convertFromString(String value, Locale locale, Convertor.FormatCache
formatCache) {
+        // Some locales (e.g. "fr") produce non-breaking spaces sent back as space by the
browser
+        value = value.replace(' ', (char)160);
         DecimalFormat decimalFormat = getDecimalFormat(locale, formatCache);
         try {
             Number decimalValue = decimalFormat.parse(value);

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingIntegerConvertor.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingIntegerConvertor.java?view=diff&r1=157076&r2=157077
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingIntegerConvertor.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingIntegerConvertor.java
Fri Mar 11 05:32:38 2005
@@ -36,6 +36,8 @@
     }
 
     public ConversionResult convertFromString(String value, Locale locale, Convertor.FormatCache
formatCache) {
+        // Some locales (e.g. "fr") produce non-breaking spaces sent back as space by the
browser
+        value = value.replace(' ', (char)160);
         DecimalFormat decimalFormat = getDecimalFormat(locale, formatCache);
         try {
             Number decimalValue = decimalFormat.parse(value);

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingLongConvertor.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingLongConvertor.java?view=diff&r1=157076&r2=157077
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingLongConvertor.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/FormattingLongConvertor.java
Fri Mar 11 05:32:38 2005
@@ -35,6 +35,8 @@
     }
 
     public ConversionResult convertFromString(String value, Locale locale, Convertor.FormatCache
formatCache) {
+        // Some locales (e.g. "fr") produce non-breaking spaces sent back as space by the
browser
+        value = value.replace(' ', (char)160);
         DecimalFormat decimalFormat = getDecimalFormat(locale, formatCache);
         try {
             Number decimalValue = decimalFormat.parse(value);



Mime
View raw message