summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Antoni Buj i Gelonch <robert.buj@gmail.com>2014-10-29 17:34:18 +0100
committerNoel Grandin <noelgrandin@gmail.com>2014-10-30 08:57:28 +0000
commit5d8ecad569fd7a254902da154ed8057ec61f3a83 (patch)
treed6c4b5ce3479fb5e0e6252c0cacd4f9da3df949d
parent9eabc1fc3b2efa3303860d33dddd013f39582861 (diff)
java: Method uses the same code for two switch clauses
Change-Id: Ied82b0a39ff9dc9c7cc9539dec2b963059f3d4a5 Reviewed-on: https://gerrit.libreoffice.org/12139 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java5
-rw-r--r--toolkit/test/accessibility/EventListener.java6
-rw-r--r--wizards/com/sun/star/wizards/common/NumericalHelper.java16
-rw-r--r--wizards/com/sun/star/wizards/db/FieldColumn.java35
-rw-r--r--wizards/com/sun/star/wizards/db/RecordParser.java55
-rw-r--r--wizards/com/sun/star/wizards/ui/FieldSelection.java15
-rw-r--r--wizards/com/sun/star/wizards/ui/FilterComponent.java11
7 files changed, 15 insertions, 128 deletions
diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
index e0e4d2d4a34a..08285f6ec080 100644
--- a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
+++ b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
@@ -703,11 +703,6 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget
break;
}
case OfficeDocumentReportTarget.STATE_IN_SECTION:
- {
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_OTHER));
- startOther(attrs);
- break;
- }
case OfficeDocumentReportTarget.STATE_IN_OTHER:
{
states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_OTHER));
diff --git a/toolkit/test/accessibility/EventListener.java b/toolkit/test/accessibility/EventListener.java
index 8d7efd5ac37f..d4d1227ac774 100644
--- a/toolkit/test/accessibility/EventListener.java
+++ b/toolkit/test/accessibility/EventListener.java
@@ -80,13 +80,7 @@ public class EventListener
break;
case AccessibleEventId.ACTION_CHANGED:
- aHandler = new EventHandler (aEvent, maTreeModel);
- break;
-
case AccessibleEventId.HYPERTEXT_CHANGED:
- aHandler = new EventHandler (aEvent, maTreeModel);
- break;
-
case AccessibleEventId.ACTIVE_DESCENDANT_CHANGED:
case AccessibleEventId.CARET_CHANGED:
case AccessibleEventId.TEXT_CHANGED:
diff --git a/wizards/com/sun/star/wizards/common/NumericalHelper.java b/wizards/com/sun/star/wizards/common/NumericalHelper.java
index 1d5e4833e040..2c93b0c876b1 100644
--- a/wizards/com/sun/star/wizards/common/NumericalHelper.java
+++ b/wizards/com/sun/star/wizards/common/NumericalHelper.java
@@ -608,32 +608,18 @@ public class NumericalHelper
switch (aTypeObject.iType)
{
case BYTE_TYPE:
- retValue = aTypeObject.aValue.toString();
- break;
case CHAR_TYPE:
- retValue = aTypeObject.aValue.toString();
- break;
case SHORT_TYPE:
- retValue = aTypeObject.aValue.toString();
- break;
case INT_TYPE:
- retValue = aTypeObject.aValue.toString();
- break;
case LONG_TYPE:
- retValue = aTypeObject.aValue.toString();
- break;
case FLOAT_TYPE:
- retValue = aTypeObject.aValue.toString();
- break;
case DOUBLE_TYPE:
+ case BOOLEAN_TYPE:
retValue = aTypeObject.aValue.toString();
break;
case STRING_TYPE:
retValue = (String) aTypeObject.aValue;
break;
- case BOOLEAN_TYPE:
- retValue = aTypeObject.aValue.toString();
- break;
case SEQUENCE_TYPE:
retValue = new String(toByteArray((aValue)));
break;
diff --git a/wizards/com/sun/star/wizards/db/FieldColumn.java b/wizards/com/sun/star/wizards/db/FieldColumn.java
index 409af6e15002..c7925144e423 100644
--- a/wizards/com/sun/star/wizards/db/FieldColumn.java
+++ b/wizards/com/sun/star/wizards/db/FieldColumn.java
@@ -256,11 +256,6 @@ public class FieldColumn
break;
case DataType.TINYINT: // == -6;
- StandardFormatKey = iNumberFormatKey;
- FieldWidth = 5;
- bIsNumberFormat = true;
- break;
-
case DataType.SMALLINT: // == 5;
StandardFormatKey = iNumberFormatKey;
FieldWidth = 5;
@@ -304,23 +299,8 @@ public class FieldColumn
break;
case DataType.DECIMAL: // == 3; [mit Nachkommastellen]
- StandardFormatKey = iNumberFormatKey;
- FieldWidth = 10 + AnyConverter.toInt(m_xColPropertySet.getPropertyValue("Scale")) + 1;
- bIsNumberFormat = true;
- break;
-
case DataType.FLOAT: // == 6;
- StandardFormatKey = iNumberFormatKey;
- FieldWidth = 10 + AnyConverter.toInt(m_xColPropertySet.getPropertyValue("Scale")) + 1;
- bIsNumberFormat = true;
- break;
-
case DataType.REAL: // == 7;
- StandardFormatKey = iNumberFormatKey;
- FieldWidth = 10 + AnyConverter.toInt(m_xColPropertySet.getPropertyValue("Scale")) + 1;
- bIsNumberFormat = true;
- break;
-
case DataType.DOUBLE: // == 8;
StandardFormatKey = iNumberFormatKey;
FieldWidth = 10 + AnyConverter.toInt(m_xColPropertySet.getPropertyValue("Scale")) + 1;
@@ -416,29 +396,14 @@ public class FieldColumn
break;
case DataType.VARCHAR: // == 12;
- DefaultValue = BlindtextCreator.getBlindTextString(FieldTitle, FieldWidth, FieldWidth);
- break;
-
case DataType.LONGVARCHAR: // == -1;
DefaultValue = BlindtextCreator.getBlindTextString(FieldTitle, FieldWidth, FieldWidth);
break;
case DataType.NUMERIC: // == 2;
- DefaultValue = Double.valueOf("9876.5");
- break;
-
case DataType.DECIMAL: // == 3; [mit Nachkommastellen]
- DefaultValue = Double.valueOf("9876.5");
- break;
-
case DataType.FLOAT: // == 6;
- DefaultValue = Double.valueOf("9876.5");
- break;
-
case DataType.REAL: // == 7;
- DefaultValue = Double.valueOf("9876.5");
- break;
-
case DataType.DOUBLE: // == 8;
DefaultValue = Double.valueOf("9876.54");
break;
diff --git a/wizards/com/sun/star/wizards/db/RecordParser.java b/wizards/com/sun/star/wizards/db/RecordParser.java
index d8acade3eaae..0f83ef1d78c6 100644
--- a/wizards/com/sun/star/wizards/db/RecordParser.java
+++ b/wizards/com/sun/star/wizards/db/RecordParser.java
@@ -132,70 +132,27 @@ public class RecordParser extends QueryMetaData
{
case DataType.BIT: // == -7;
case DataType.BOOLEAN:
- oAny = getColumnDoubleValue(ColIndex, false);
- break;
-
case DataType.TINYINT: // == -6;
- oAny = getColumnDoubleValue(ColIndex, false);
- break;
-
case DataType.BIGINT: // == -5;
- oAny = getColumnDoubleValue(ColIndex, false);
- break;
-
- case DataType.CHAR: // == 1;
- oAny = getColumnStringValue(ColIndex);
- break;
-
- case DataType.VARCHAR: // == 12;
- oAny = getColumnStringValue(ColIndex);
- // double sResult = xResultSetRow.getClob(ColIndex); //???
- break;
-
- case DataType.LONGVARCHAR: // == -1;
- oAny = getColumnStringValue(ColIndex);
- // double sResult = xResultSetRow.getCharacterStream(ColIndex);
- break;
-
case DataType.NUMERIC: // == 2;
- oAny = getColumnDoubleValue(ColIndex, false);
- break;
-
case DataType.INTEGER: // == 4;
- oAny = getColumnDoubleValue(ColIndex, false);
- break;
-
case DataType.SMALLINT: // == 5;
- oAny = getColumnDoubleValue(ColIndex, false);
- break;
-
case DataType.DECIMAL: // == 3; [mit Nachkommastellen]
- oAny = getColumnDoubleValue(ColIndex, false);
- break;
-
case DataType.FLOAT: // == 6;
- oAny = getColumnDoubleValue(ColIndex, false);
- break;
-
case DataType.REAL: // == 7;
- oAny = getColumnDoubleValue(ColIndex, false);
- break;
-
case DataType.DOUBLE: // == 8;
- oAny = getColumnDoubleValue(ColIndex, false);
- break;
-
case DataType.DATE: // == 91;
- oAny = getColumnDoubleValue(ColIndex, true);
- break;
-
case DataType.TIME: // == 92;
+ case DataType.TIMESTAMP: // == 93;
oAny = getColumnDoubleValue(ColIndex, false);
break;
- case DataType.TIMESTAMP: // == 93;
- oAny = getColumnDoubleValue(ColIndex, true);
+ case DataType.CHAR: // == 1;
+ case DataType.VARCHAR: // == 12;
+ case DataType.LONGVARCHAR: // == -1;
+ oAny = getColumnStringValue(ColIndex);
break;
+
}
// Is the index OK; increment?
diff --git a/wizards/com/sun/star/wizards/ui/FieldSelection.java b/wizards/com/sun/star/wizards/ui/FieldSelection.java
index 763fcc6a7b3b..193aa26aadae 100644
--- a/wizards/com/sun/star/wizards/ui/FieldSelection.java
+++ b/wizards/com/sun/star/wizards/ui/FieldSelection.java
@@ -67,14 +67,11 @@ public class FieldSelection
int iKey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList);
switch (iKey)
{
-
case SOFLDSLST:
- toggleListboxButtons((short) - 1, (short) - 1);
- break;
-
case SOSELFLDSLST:
toggleListboxButtons((short) - 1, (short) - 1);
break;
+
default:
break;
}
@@ -100,15 +97,8 @@ public class FieldSelection
int iKey = CurUnoDialog.getControlKey(actionEvent.Source, CurUnoDialog.ControlList);
switch (iKey)
{
- case SOFLDSLST:
- selectFields(false);
- break;
-
- case SOSELFLDSLST:
- deselectFields(false);
- break;
-
case SOCMDMOVESEL:
+ case SOFLDSLST:
selectFields(false);
break;
@@ -117,6 +107,7 @@ public class FieldSelection
break;
case SOCMDREMOVESEL:
+ case SOSELFLDSLST:
deselectFields(false);
break;
diff --git a/wizards/com/sun/star/wizards/ui/FilterComponent.java b/wizards/com/sun/star/wizards/ui/FilterComponent.java
index 072cafd715eb..f306314dc9c3 100644
--- a/wizards/com/sun/star/wizards/ui/FilterComponent.java
+++ b/wizards/com/sun/star/wizards/ui/FilterComponent.java
@@ -139,16 +139,11 @@ public class FilterComponent
aNumberFormatter.setNumberFormat(xValueModel, CurFieldColumn.getDBFormatKey(), aNumberFormatter);
break;
+
case SO_FIRSTCONDITION:
case SO_SECONDCONDITION:
case SO_THIRDCONDITION:
case SO_FOURTHCONDITION:
- sControlName = getControlName(EventObject.Source);
- break;
- case SOOPTORMODE:
- case SOOPTANDMODE:
- return;
-
case SO_FIRSTBOOLFIELDNAME:
case SO_SECONDBOOLFIELDNAME:
case SO_THIRDBOOLFIELDNAME:
@@ -156,6 +151,10 @@ public class FilterComponent
sControlName = getControlName(EventObject.Source);
break;
+ case SOOPTORMODE:
+ case SOOPTANDMODE:
+ return;
+
default:
break;
}