[Libreoffice-commits] core.git: wizards/com

rbuj robert.buj at gmail.com
Wed Aug 20 07:09:46 PDT 2014


 wizards/com/sun/star/wizards/common/NumericalHelper.java |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit e5070e0cc2bc7c19668846d3faaa1b97e3440f06
Author: rbuj <robert.buj at gmail.com>
Date:   Wed Aug 20 12:34:07 2014 +0200

    wizards: Number parsing
    
    Change-Id: If81db8cf10556dbb79458258a70760e3f12a5524
    Reviewed-on: https://gerrit.libreoffice.org/11041
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/wizards/com/sun/star/wizards/common/NumericalHelper.java b/wizards/com/sun/star/wizards/common/NumericalHelper.java
index dd1c731..f2c6e76 100644
--- a/wizards/com/sun/star/wizards/common/NumericalHelper.java
+++ b/wizards/com/sun/star/wizards/common/NumericalHelper.java
@@ -97,8 +97,7 @@ public class NumericalHelper
             case STRING_TYPE:
                 try
                 {
-                    Integer i = Integer.valueOf((String) aTypeObject.aValue);
-                    retValue = i.intValue();
+                    retValue = Integer.parseInt((String) aTypeObject.aValue);
                 }
                 catch (java.lang.NumberFormatException e)
                 {
@@ -152,8 +151,7 @@ public class NumericalHelper
             case STRING_TYPE:
                 try
                 {
-                    Float f = new Float((String) aTypeObject.aValue);
-                    retValue = f.floatValue();
+                    retValue = Float.parseFloat((String) aTypeObject.aValue);
                 }
                 catch (java.lang.NumberFormatException e)
                 {
@@ -207,8 +205,7 @@ public class NumericalHelper
             case STRING_TYPE:
                 try
                 {
-                    Boolean b = Boolean.valueOf((String) aTypeObject.aValue);
-                    retValue = b.booleanValue();
+                    retValue = Boolean.parseBoolean((String) aTypeObject.aValue);
                 }
                 catch (java.lang.NumberFormatException e)
                 {


More information about the Libreoffice-commits mailing list