diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-05 15:29:21 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-08 09:48:20 +0200 |
commit | 616b3ad50404f35d84708b3feeb8c66f2f23f1b1 (patch) | |
tree | fbff023a34b3cc62b2c5beb592b95e65ce28251b /wizards/com/sun/star/wizards/report/ReportTextDocument.java | |
parent | b6a83e99c8f4442c3c96198ac816dcb99419a67e (diff) |
java: remove exceptions from throws clauses that are not
.. actually thrown
Change-Id: Ia326ac7f82e11b948ed0f34e20908a96e7adcd10
Diffstat (limited to 'wizards/com/sun/star/wizards/report/ReportTextDocument.java')
-rw-r--r-- | wizards/com/sun/star/wizards/report/ReportTextDocument.java | 90 |
1 files changed, 38 insertions, 52 deletions
diff --git a/wizards/com/sun/star/wizards/report/ReportTextDocument.java b/wizards/com/sun/star/wizards/report/ReportTextDocument.java index cd6af8c937f8..ed6a9bcfe319 100644 --- a/wizards/com/sun/star/wizards/report/ReportTextDocument.java +++ b/wizards/com/sun/star/wizards/report/ReportTextDocument.java @@ -346,7 +346,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen } } - public void updateTextSections(String[] SelGroupNames) throws Exception + public void updateTextSections(String[] SelGroupNames) { String TableName; DBColumn OldDBColumn; @@ -395,48 +395,41 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen public void insertColumnstoRecordTable() { - try + int GroupCount = CurDBMetaData.GroupFieldNames.length; + DBColumn CurDBColumn; + // Note for some reason the table might lose its name and has to be renamed therefor + String OldTableName = CurRecordTable.xTableName.getName(); + if (OldTableName.compareTo(TBLRECORDSECTION) != 0) { - int GroupCount = CurDBMetaData.GroupFieldNames.length; - DBColumn CurDBColumn; - // Note for some reason the table might lose its name and has to be renamed therefor - String OldTableName = CurRecordTable.xTableName.getName(); - if (OldTableName.compareTo(TBLRECORDSECTION) != 0) - { - CurRecordTable = new RecordTable(oTextTableHandler); - } - com.sun.star.table.XTableColumns xColumns = CurRecordTable.xTextTable.getColumns(); - int ColCount = xColumns.getCount(); - int RecordCount = CurDBMetaData.getRecordFieldNames().length; - if (ColCount > RecordCount) - { - int RemoveCount = ColCount - RecordCount; - xColumns.removeByIndex(0, RemoveCount); - } - else if (ColCount < RecordCount) + CurRecordTable = new RecordTable(oTextTableHandler); + } + com.sun.star.table.XTableColumns xColumns = CurRecordTable.xTextTable.getColumns(); + int ColCount = xColumns.getCount(); + int RecordCount = CurDBMetaData.getRecordFieldNames().length; + if (ColCount > RecordCount) + { + int RemoveCount = ColCount - RecordCount; + xColumns.removeByIndex(0, RemoveCount); + } + else if (ColCount < RecordCount) + { + int AddCount = RecordCount - ColCount; + CurRecordTable.xTextTable.getColumns().insertByIndex(ColCount, AddCount); + } + for (int i = 0; i < RecordCount; i++) + { + CurDBColumn = new DBColumn(CurRecordTable, oTextTableHandler, CurDBMetaData, i, true); + CurDBColumn.initializeNumberFormat(); + CurDBColumn.insertColumnData(oTextFieldHandler, this.bIsCurLandscape); + if (DBColumnsVector.size() <= (i + GroupCount)) { - int AddCount = RecordCount - ColCount; - CurRecordTable.xTextTable.getColumns().insertByIndex(ColCount, AddCount); + DBColumnsVector.add(CurDBColumn); } - for (int i = 0; i < RecordCount; i++) + else { - CurDBColumn = new DBColumn(CurRecordTable, oTextTableHandler, CurDBMetaData, i, true); - CurDBColumn.initializeNumberFormat(); - CurDBColumn.insertColumnData(oTextFieldHandler, this.bIsCurLandscape); - if (DBColumnsVector.size() <= (i + GroupCount)) - { - DBColumnsVector.add(CurDBColumn); - } - else - { - DBColumnsVector.set(i + GroupCount, CurDBColumn); - } + DBColumnsVector.set(i + GroupCount, CurDBColumn); } } - catch (Exception exception) - { - showCommonReportErrorBox(exception); - } } public boolean addGroupNametoDocument(String[] GroupNames, String CurGroupTitle, ArrayList<String> GroupFieldVector, ArrayList<String> ReportPath, int iSelCount) @@ -473,23 +466,16 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen removeGroupNamesofRecordTable(NewSelGroupNames.length + 1); FieldColumn CurFieldColumn = CurDBMetaData.getFieldColumnByTitle(CurGroupTitle); GroupFieldVector.remove(CurFieldColumn.getFieldName()); - try + oTextSectionHandler.removeLastTextSection(); + oTextTableHandler.removeLastTextTable(); + // if the previously selected item is somewhere in the middle of the listbox (and not at the end) the + // Textsections have to be updated + if (JavaTools.FieldInList(NewSelGroupNames, CurGroupTitle) == -1) { - oTextSectionHandler.removeLastTextSection(); - oTextTableHandler.removeLastTextTable(); - // if the previously selected item is somewhere in the middle of the listbox (and not at the end) the - // Textsections have to be updated - if (JavaTools.FieldInList(NewSelGroupNames, CurGroupTitle) == -1) - { - updateTextSections(NewSelGroupNames); - } - int iSelItemCount = NewSelGroupNames.length; - DBColumnsVector.remove(iSelItemCount); - } - catch (Exception exception) - { - showCommonReportErrorBox(exception); + updateTextSections(NewSelGroupNames); } + int iSelItemCount = NewSelGroupNames.length; + DBColumnsVector.remove(iSelItemCount); } public void removeGroupNamesofRecordTable(int GroupFieldCount) |