summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/common/NumericalHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'wizards/com/sun/star/wizards/common/NumericalHelper.java')
-rw-r--r--wizards/com/sun/star/wizards/common/NumericalHelper.java45
1 files changed, 22 insertions, 23 deletions
diff --git a/wizards/com/sun/star/wizards/common/NumericalHelper.java b/wizards/com/sun/star/wizards/common/NumericalHelper.java
index 109affffd5ef..3a1c3b4ecf0f 100644
--- a/wizards/com/sun/star/wizards/common/NumericalHelper.java
+++ b/wizards/com/sun/star/wizards/common/NumericalHelper.java
@@ -411,7 +411,7 @@ public class NumericalHelper
// return toInt(_aValue);
// }
// catch(com.sun.star.lang.IllegalArgumentException e) {
-// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, "");
+// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, PropertyNames.EMPTY_STRING);
// return 0;
// }}
//
@@ -421,8 +421,8 @@ public class NumericalHelper
// return toString(_aValue);
// }
// catch(com.sun.star.lang.IllegalArgumentException e) {
-// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, "");
-// return "";
+// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, PropertyNames.EMPTY_STRING);
+// return PropertyNames.EMPTY_STRING;
// }}
//
//
@@ -431,7 +431,7 @@ public class NumericalHelper
// return toInt(_aValue, _ndefaultValue);
// }
// catch(com.sun.star.uno.Exception e) {
-// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, "");
+// DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, PropertyNames.EMPTY_STRING);
// return 0;
// }}
//
@@ -445,7 +445,7 @@ public class NumericalHelper
// return toBoolean(_oObject);
// }
// catch (java.lang.Exception e){
-// DebugHelper.exception(BasicErrorCode.SbERR_BAD_ARGUMENT, "");
+// DebugHelper.exception(BasicErrorCode.SbERR_BAD_ARGUMENT, PropertyNames.EMPTY_STRING);
// return false;
// }
// }
@@ -461,11 +461,11 @@ public class NumericalHelper
// return false;
// }
// else{
-// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, "");
+// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING);
// return false;
// }
// }catch (java.lang.Exception e){
-// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, "");
+// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING);
// return false;
// }}
//
@@ -489,12 +489,12 @@ public class NumericalHelper
// return false;
// }
// else{
-// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, "");
+// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING);
// return false;
// }
// }
// }catch (java.lang.Exception e){
-// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, "");
+// DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING);
// return false;
// }}
/**
@@ -735,31 +735,31 @@ public class NumericalHelper
switch (aTypeObject.iType)
{
case BYTE_TYPE:
- retValue = ((Byte) aTypeObject.aValue).toString();
+ retValue = aTypeObject.aValue.toString();
break;
case CHAR_TYPE:
- retValue = ((Character) aTypeObject.aValue).toString();
+ retValue = aTypeObject.aValue.toString();
break;
case SHORT_TYPE:
- retValue = ((Short) aTypeObject.aValue).toString();
+ retValue = aTypeObject.aValue.toString();
break;
case INT_TYPE:
- retValue = ((Integer) aTypeObject.aValue).toString();
+ retValue = aTypeObject.aValue.toString();
break;
case LONG_TYPE:
- retValue = ((Long) aTypeObject.aValue).toString();
+ retValue = aTypeObject.aValue.toString();
break;
case FLOAT_TYPE:
- retValue = ((Float) aTypeObject.aValue).toString();
+ retValue = aTypeObject.aValue.toString();
break;
case DOUBLE_TYPE:
- retValue = ((Double) aTypeObject.aValue).toString();
+ retValue = aTypeObject.aValue.toString();
break;
case STRING_TYPE:
retValue = (String) aTypeObject.aValue;
break;
case BOOLEAN_TYPE:
- retValue = ((Boolean) aTypeObject.aValue).toString();
+ retValue = aTypeObject.aValue.toString();
break;
case ARRAY_TYPE:
retValue = new String(toByteArray((aValue)));
@@ -983,13 +983,13 @@ public class NumericalHelper
}
else
{
- DebugHelper.exception(1/* BasicErrorCode.SbERR_CONVERSION*/, "");
+ DebugHelper.exception(1/* BasicErrorCode.SbERR_CONVERSION*/, PropertyNames.EMPTY_STRING);
}
}
}
catch (com.sun.star.uno.Exception e)
{
- DebugHelper.exception(1 /*BasicErrorCode.SbERR_METHOD_FAILED*/, "");
+ DebugHelper.exception(1 /*BasicErrorCode.SbERR_METHOD_FAILED*/, PropertyNames.EMPTY_STRING);
}
return nreturn;
}
@@ -1511,7 +1511,7 @@ public class NumericalHelper
// }
// }
// catch (com.sun.star.uno.Exception e){
-// DebugHelper.exception(1 /*BasicErrorCode.SbERR_METHOD_FAILED*/, "");
+// DebugHelper.exception(1 /*BasicErrorCode.SbERR_METHOD_FAILED*/, PropertyNames.EMPTY_STRING);
// return false;
// }}
/**
@@ -1554,7 +1554,7 @@ public class NumericalHelper
{
if (n > MAX_NUMBER || n < MIN_NUMBER)
{
- DebugHelper.exception(1 /*BasicErrorCode.SbERR_OUT_OF_RANGE*/, "");
+ DebugHelper.exception(1 /*BasicErrorCode.SbERR_OUT_OF_RANGE*/, PropertyNames.EMPTY_STRING);
}
String number = NumericalHelper.toString(new Integer(n));
/* converison idea: every digit is written with a maximum of two
@@ -1619,7 +1619,6 @@ public class NumericalHelper
public static double roundDouble(double _dblvalue, int _ndecimals)
{
double dblfactor = java.lang.Math.pow(10.0, (double) _ndecimals);
- double dblretvalue = ((double) ((int) (_dblvalue * dblfactor))) / dblfactor;
- return dblretvalue;
+ return ((double) ((int) (_dblvalue * dblfactor))) / dblfactor;
}
}