diff options
Diffstat (limited to 'qadevOOo/tests/java/mod/_sc')
94 files changed, 187 insertions, 243 deletions
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java index 743e8388cee6..64f34d4acc41 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java @@ -130,9 +130,9 @@ public class ScAccessibleCell extends TestCase { xCell = oSheet.getCellByPosition(1, 0) ; xCell.setFormula(text); XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, oSheet); - XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); + XTableColumns oColumns = oColumnRowRange.getColumns(); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oColumns); - XPropertySet column = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet column = UnoRuntime.queryInterface( XPropertySet.class,oIndexAccess.getByIndex(1)); column.setPropertyValue("OptimalWidth", new Boolean(true)); } catch(com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java index 548b7b94e72e..d3842c014c03 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java @@ -177,8 +177,7 @@ public class ScAccessiblePageHeader extends TestCase { } //get the property-set - final XPropertySet PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + final XPropertySet PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java index 34f86a372354..d7d18f8e2914 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java @@ -182,11 +182,11 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { try { Object oPageStyles = xNA.getByName("PageStyles"); - xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, + xNA = UnoRuntime.queryInterface(XNameAccess.class, oPageStyles); Object oDefStyle = xNA.getByName("Default"); - xPropSet = (XPropertySet) UnoRuntime.queryInterface( + xPropSet = UnoRuntime.queryInterface( XPropertySet.class, oDefStyle); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java index 2cc6362caf6b..fb61f60d32b6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java @@ -123,15 +123,14 @@ public class ScAnnotationObj extends TestCase { log.println("Getting test object ") ; XSpreadsheetDocument xArea = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); - XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); + XSpreadsheets oSheets = xArea.getSheets(); XIndexAccess XAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCell oCell = null; try { XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),XAccess.getByIndex(cellPos.Sheet)); - XCellRange oCRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oCRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); oCell = oCRange.getCellByPosition(cellPos.Column, cellPos.Row); } catch(com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java index c3f8ba5e1ba7..4daf692d73e2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java @@ -135,7 +135,7 @@ public class ScAnnotationShapeObj extends TestCase { XSpreadsheetDocument xArea = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); - XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); + XSpreadsheets oSheets = xArea.getSheets(); XIndexAccess XAccess = UnoRuntime.queryInterface(XIndexAccess.class, @@ -148,8 +148,8 @@ public class ScAnnotationShapeObj extends TestCase { XSpreadsheet.class), XAccess.getByIndex(cellPos.Sheet)); XCellRange oCRange = - (XCellRange) UnoRuntime.queryInterface(XCellRange.class, - oSheet); + UnoRuntime.queryInterface(XCellRange.class, + oSheet); oCell = oCRange.getCellByPosition(cellPos.Column, cellPos.Row); } catch (com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java index bbb2f12bc65b..11171c8f9e4a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java @@ -104,14 +104,13 @@ public class ScAnnotationTextCursor extends TestCase { XSpreadsheetDocument xArea = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); - XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); + XSpreadsheets oSheets = xArea.getSheets(); XIndexAccess XAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet)XAccess.getByIndex(cellPos.Sheet); - XCellRange oCRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oCRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCell oCell = oCRange.getCellByPosition(cellPos.Column, cellPos.Row); diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java index c341d016c67e..17cfffccb73f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java @@ -110,10 +110,9 @@ public class ScAnnotationsObj extends TestCase { log.println("Getting test object ") ; XSpreadsheetDocument xSpreadsheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); - XSpreadsheets sheets = (XSpreadsheets) xSpreadsheetDoc.getSheets(); + XSpreadsheets sheets = xSpreadsheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, sheets ); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, sheets ); XCell oCell = null; XSpreadsheet oSheet = null; try { @@ -121,8 +120,7 @@ public class ScAnnotationsObj extends TestCase { new Type(XSpreadsheet.class), oNames.getByName(oNames.getElementNames()[0])); // adding an annotation... - XCellRange oCRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oCRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); oCell = oCRange.getCellByPosition(10,10); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java index 002ca496ccac..563bd6b4942a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java @@ -108,7 +108,7 @@ public class ScAreaLinkObj extends TestCase { try { // creation of testobject here - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface + XPropertySet props = UnoRuntime.queryInterface (XPropertySet.class, xSheetDoc); XAreaLinks links = (XAreaLinks) AnyConverter.toObject( new Type(XAreaLinks.class),props.getPropertyValue("AreaLinks")) ; diff --git a/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java b/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java index 45bae04e30f0..74f02ca75aae 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java @@ -105,14 +105,14 @@ public class ScAreaLinksObj extends TestCase { try { // creation of testobject here - XPropertySet props = (XPropertySet)UnoRuntime.queryInterface + XPropertySet props = UnoRuntime.queryInterface (XPropertySet.class, xSheetDoc); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),props.getPropertyValue("AreaLinks")) ; XAreaLinks links = null ; // adding one link into collection (for best testing) - links = (XAreaLinks) UnoRuntime.queryInterface(XAreaLinks.class, oObj) ; + links = UnoRuntime.queryInterface(XAreaLinks.class, oObj) ; CellAddress addr = new CellAddress ((short) 1,2,3) ; String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc"); links.insertAtPosition (addr, aSourceArea, "a2:b5", "", "") ; diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java index 411334cf5e2f..0a012a181672 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java @@ -74,7 +74,7 @@ public class ScAutoFormatObj extends TestCase { PrintWriter log) { XInterface oObj = null; - XMultiServiceFactory oMSF = (XMultiServiceFactory)(XMultiServiceFactory)tParam.getMSF(); + XMultiServiceFactory oMSF = (XMultiServiceFactory)tParam.getMSF(); try { XInterface formats = (XInterface)oMSF.createInstance ("com.sun.star.sheet.TableAutoFormats"); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java b/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java index a9a732ac16dd..be5780cd0461 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java @@ -222,7 +222,7 @@ public class ScCellCursorObj extends TestCase { { "", "2", "3", "4" } }); - XPropertySet PropSet = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet PropSet = UnoRuntime.queryInterface( XPropertySet.class, oObj); tEnv.addObjRelation("PropSet", PropSet); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java index 8aa19354cff7..17a60dcd8640 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java @@ -103,7 +103,7 @@ public class ScCellFormatsEnumeration extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java index c6ffccbd1160..37df8a1405f6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java @@ -95,7 +95,7 @@ public class ScCellFormatsObj extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScCellObj.java b/qadevOOo/tests/java/mod/_sc/ScCellObj.java index 51e85aa9006e..c29dbc3e42a1 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellObj.java @@ -194,8 +194,7 @@ public class ScCellObj extends TestCase { // XTextFieldsSupplier tEnv.addObjRelation("SPREADSHEET", xSheetDoc); - XPropertySet PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet PropSet = UnoRuntime.queryInterface(XPropertySet.class, oObj); tEnv.addObjRelation("PropSet",PropSet); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java index c16d4fff4761..ce8154207489 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java @@ -142,7 +142,7 @@ public class ScCellRangeObj extends TestCase { XSpreadsheets oSpreadsheets = UnoRuntime.queryInterface( XSpreadsheetDocument.class, xSheetDoc).getSheets(); - XNameAccess oNames = (XNameAccess) UnoRuntime.queryInterface( + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, oSpreadsheets); XSpreadsheet oSheet = null; @@ -153,7 +153,7 @@ public class ScCellRangeObj extends TestCase { oNames.getByName(oNames.getElementNames()[0])); oObj = oSheet.getCellRangeByPosition(0, 0, 3, 4); - testRange = (XCellRange) UnoRuntime.queryInterface( + testRange = UnoRuntime.queryInterface( XCellRange.class, oObj); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); @@ -189,7 +189,7 @@ public class ScCellRangeObj extends TestCase { tEnv.addObjRelation("XCellRangesQuery.EXPECTEDRESULTS", expectedResults); tEnv.addObjRelation("XCellRangesQuery.CREATEENTRIES", Boolean.TRUE); - XPropertySet PropSet = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet PropSet = UnoRuntime.queryInterface( XPropertySet.class, oObj); tEnv.addObjRelation("PropSet", PropSet); @@ -199,7 +199,7 @@ public class ScCellRangeObj extends TestCase { testRange.getCellByPosition(0,0), testRange.getCellByPosition(0,1)}); } catch(com.sun.star.lang.IndexOutOfBoundsException e){ - e.printStackTrace((PrintWriter)log); + e.printStackTrace(log); log.println("Cannot make required object relation 'XSearchable.MAKEENTRYINCELL'."); } diff --git a/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java index e50a26489464..dc8136008ff5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java @@ -156,8 +156,7 @@ public class ScCellRangesObj extends TestCase { try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), oIndSheets.getByIndex(0)); - XNameContainer oRanges = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oObj); + XNameContainer oRanges = UnoRuntime.queryInterface(XNameContainer.class, oObj); oRange = oSheet.getCellRangeByName("C1:D4"); oRanges.insertByName("Range1", oRange); @@ -225,8 +224,7 @@ public class ScCellRangesObj extends TestCase { tEnv.addObjRelation("INSTANCE" + n, oRange); } - XPropertySet PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet PropSet = UnoRuntime.queryInterface(XPropertySet.class, oObj); tEnv.addObjRelation("PropSet",PropSet); tEnv.addObjRelation("SHEET", oSheet); // add expected results for the XCellRangesQuery interface test diff --git a/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java b/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java index 1708d297bced..cff9e9b9bc6f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java @@ -106,7 +106,7 @@ public class ScCellSearchObj extends TestCase { log.println( "creating a test environment" ); log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java index 7547e35cb464..6bc31581fbe2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java @@ -107,21 +107,21 @@ public class ScCellsEnumeration extends TestCase { XEnumerationAccess oEnum = null; // creation of testobject here - XSpreadsheets oSheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets oSheets = xSheetDoc.getSheets(); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCellRange oSheet = null; try { oSheet = (XCellRange) AnyConverter.toObject( new Type(XCellRange.class),oIndexAccess.getByIndex(0)); - XCell oCell_1 = (XCell)oSheet.getCellByPosition(0, 0); + XCell oCell_1 = oSheet.getCellByPosition(0, 0); XTextRange oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_1); oTextRange.setString("Test string 1"); - XCell oCell_2 = (XCell)oSheet.getCellByPosition(5, 1); + XCell oCell_2 = oSheet.getCellByPosition(5, 1); oCell_2.setValue(15); - XCell oCell_3 = (XCell)oSheet.getCellByPosition(3, 9); + XCell oCell_3 = oSheet.getCellByPosition(3, 9); oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_3); oTextRange.setString("test 2"); cellArr[0] = oCell_1; @@ -143,7 +143,7 @@ public class ScCellsEnumeration extends TestCase { XCellRangesQuery oCellRangesQuery = UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet); XSheetCellRanges oSheetCellRanges = oCellRangesQuery.queryVisibleCells(); - oEnum = (XEnumerationAccess) oSheetCellRanges.getCells(); + oEnum = oSheetCellRanges.getCells(); oObj = oSheetCellRanges.getCells().createEnumeration(); TestEnvironment tEnv = new TestEnvironment(oObj); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellsObj.java index 33efd3dd4916..ac4a5700ddc3 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellsObj.java @@ -101,22 +101,22 @@ public class ScCellsObj extends TestCase { Object cellArr[] = new Object[3]; // creation of testobject here - XSpreadsheets oSheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets oSheets = xSheetDoc.getSheets(); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCellRange oSheet = null; try { oSheet = (XCellRange) AnyConverter.toObject( new Type(XCellRange.class),oIndexAccess.getByIndex(0)); - XCell oCell_1 = (XCell)oSheet.getCellByPosition(0, 0); + XCell oCell_1 = oSheet.getCellByPosition(0, 0); XTextRange oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_1); oTextRange.setString("ScCellsObj test 1"); - XCell oCell_2 = (XCell)oSheet.getCellByPosition(5, 1); + XCell oCell_2 = oSheet.getCellByPosition(5, 1); oCell_2.setValue(15); - XCell oCell_3 = (XCell)oSheet.getCellByPosition(3, 9); + XCell oCell_3 = oSheet.getCellByPosition(3, 9); oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_3); oTextRange.setString("ScCellsObj test 2"); diff --git a/qadevOOo/tests/java/mod/_sc/ScChartObj.java b/qadevOOo/tests/java/mod/_sc/ScChartObj.java index a68749b44f9e..0b84c746b0c5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScChartObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScChartObj.java @@ -197,8 +197,7 @@ public class ScChartObj extends TestCase { Rectangle oRect = new Rectangle(500, 3000, 25000, 11000); - XCellRange oRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScChartsObj.java b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java index baf429e8ef3f..b7b900b0bc65 100644 --- a/qadevOOo/tests/java/mod/_sc/ScChartsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java @@ -204,8 +204,7 @@ public class ScChartsObj extends TestCase { // insert a chart Rectangle oRect = new Rectangle(500, 3000, 25000, 11000); - XCellRange oRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java b/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java index 5c7767ece6d3..6e693850e5ae 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java @@ -150,7 +150,7 @@ public class ScDDELinkObj extends TestCase { } log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -188,8 +188,7 @@ public class ScDDELinkObj extends TestCase { log.println("Getting test object ") ; // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); XNameAccess links = (XNameAccess) AnyConverter.toObject( new Type(XNameAccess.class), UnoRuntime.queryInterface( XNameAccess.class, docProps.getPropertyValue("DDELinks"))); diff --git a/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java b/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java index f2490f3f2bd8..58c2bd061bb6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java @@ -130,7 +130,7 @@ public class ScDDELinksObj extends TestCase { } log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -168,8 +168,7 @@ public class ScDDELinksObj extends TestCase { log.println("Getting test object ") ; // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); oObj = (XInterface)AnyConverter.toObject( new Type(XInterface.class),docProps.getPropertyValue("DDELinks")); log.println("Creating object - " + diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java index df2b4a5cc841..2b7714422ff1 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java @@ -119,7 +119,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase log.println ("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( @@ -227,19 +227,19 @@ public class ScDataPilotFieldGroupItemObj extends TestCase try { Object oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.ROW); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (1); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Function", com.sun.star.sheet.GeneralFunction.SUM); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.DATA); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (2); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.COLUMN); @@ -331,10 +331,10 @@ public class ScDataPilotFieldGroupItemObj extends TestCase { datapilotfield = (XInterface) AnyConverter.toObject ( new Type (XInterface.class), IA.getByIndex (i)); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); + XPropertySet xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { - xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); + xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); XNamed xNamed = UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); System.out.println ("name: "+xNamed.getName ()); dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo"); @@ -342,8 +342,8 @@ public class ScDataPilotFieldGroupItemObj extends TestCase } groups = dpgi.Groups; XIndexAccess groupAccess = UnoRuntime.queryInterface(XIndexAccess.class, groups); - XNameAccess groupNames = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, groupAccess.getByIndex(0)); - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, groupNames.getByName("aName")); + XNameAccess groupNames = UnoRuntime.queryInterface(XNameAccess.class, groupAccess.getByIndex(0)); + oObj = UnoRuntime.queryInterface(XInterface.class, groupNames.getByName("aName")); } catch (Exception e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java index 7f650e391669..2fc1fa4f5bda 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java @@ -118,7 +118,7 @@ public class ScDataPilotFieldGroupObj extends TestCase log.println ("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( @@ -226,19 +226,19 @@ public class ScDataPilotFieldGroupObj extends TestCase try { Object oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.ROW); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (1); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Function", com.sun.star.sheet.GeneralFunction.SUM); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.DATA); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (2); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.COLUMN); @@ -330,10 +330,10 @@ public class ScDataPilotFieldGroupObj extends TestCase { datapilotfield = (XInterface) AnyConverter.toObject ( new Type (XInterface.class), IA.getByIndex (i)); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); + XPropertySet xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { - xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); + xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); XNamed xNamed = UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); System.out.println ("name: "+xNamed.getName ()); dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo"); @@ -341,7 +341,7 @@ public class ScDataPilotFieldGroupObj extends TestCase } groups = dpgi.Groups; XIndexAccess groupAccess = UnoRuntime.queryInterface(XIndexAccess.class, groups); - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, groupAccess.getByIndex(0)); + oObj = UnoRuntime.queryInterface(XInterface.class, groupAccess.getByIndex(0)); } catch (Exception e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java index 7805d7d9ed70..7899d586b068 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java @@ -118,7 +118,7 @@ public class ScDataPilotFieldGroupsObj extends TestCase log.println ("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( @@ -226,19 +226,19 @@ public class ScDataPilotFieldGroupsObj extends TestCase try { Object oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.ROW); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (1); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Function", com.sun.star.sheet.GeneralFunction.SUM); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.DATA); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (2); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.COLUMN); @@ -330,10 +330,10 @@ public class ScDataPilotFieldGroupsObj extends TestCase { datapilotfield = (XInterface) AnyConverter.toObject ( new Type (XInterface.class), IA.getByIndex (i)); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); + XPropertySet xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { - xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); + xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); XNamed xNamed = UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); System.out.println ("name: "+xNamed.getName ()); dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo"); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java index 0e07ddfb1e4f..862cd89cf96a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java @@ -140,7 +140,7 @@ public class ScDataPilotFieldObj extends TestCase { log.println("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface( @@ -223,7 +223,7 @@ public class ScDataPilotFieldObj extends TestCase { try { Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface( + fieldPropSet = UnoRuntime.queryInterface( XPropertySet.class, oDataPilotField); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(); @@ -320,7 +320,7 @@ public class ScDataPilotFieldObj extends TestCase { if (!name.equals("Data")) { fieldsNames[cnt] = name; - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet props = UnoRuntime.queryInterface( XPropertySet.class, field); try { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java index dd91506fc6fe..2b5573ee41db 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java @@ -110,7 +110,7 @@ public class ScDataPilotFieldsObj extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java index eec1c97364ff..7bb82070f96c 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java @@ -141,7 +141,7 @@ public class ScDataPilotItemObj extends TestCase { log.println("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface( @@ -224,7 +224,7 @@ public class ScDataPilotItemObj extends TestCase { try { Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface( + fieldPropSet = UnoRuntime.queryInterface( XPropertySet.class, oDataPilotField); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(); @@ -287,7 +287,7 @@ public class ScDataPilotItemObj extends TestCase { XIndexAccess xIA = xDataPilotField.getItems(); try { - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, + oObj = UnoRuntime.queryInterface(XInterface.class, xIA.getByIndex(0)); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { log.println("Couldn't get DataPilotItemObj"); @@ -338,7 +338,7 @@ public class ScDataPilotItemObj extends TestCase { if (!name.equals("Data")) { fieldsNames[cnt] = name; - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet props = UnoRuntime.queryInterface( XPropertySet.class, field); try { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java index 60f40eefa7b8..804c3a255fe2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java @@ -141,7 +141,7 @@ public class ScDataPilotItemsObj extends TestCase { log.println("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface( @@ -224,7 +224,7 @@ public class ScDataPilotItemsObj extends TestCase { try { Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface( + fieldPropSet = UnoRuntime.queryInterface( XPropertySet.class, oDataPilotField); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(); @@ -326,7 +326,7 @@ public class ScDataPilotItemsObj extends TestCase { if (!name.equals("Data")) { fieldsNames[cnt] = name; - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet props = UnoRuntime.queryInterface( XPropertySet.class, field); try { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java index e5301fe94080..19ee1dcc47ea 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java @@ -206,8 +206,7 @@ public class ScDataPilotTableObj extends TestCase { XPropertySet fieldPropSet = null; try { Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0); - fieldPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oDataPilotField); + fieldPropSet = UnoRuntime.queryInterface(XPropertySet.class, oDataPilotField); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); throw new StatusException("Couldn't create a test environment", e); @@ -293,7 +292,7 @@ public class ScDataPilotTableObj extends TestCase { for (int i = 0; i < fieldCount; ++i) { Object o = xIA.getByIndex(i); - XPropertySet fieldPropSet = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet fieldPropSet = UnoRuntime.queryInterface( XPropertySet.class, o); if (i == fieldCount - 1) diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java index a4afcd727729..9ff3ebbf1fa7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java @@ -117,7 +117,7 @@ public class ScDataPilotTablesObj extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java index 80a614fb7e4e..a63d9222a512 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java @@ -130,7 +130,7 @@ public class ScDatabaseRangeObj extends TestCase { log.println("Getting test object "); - XPropertySet docProps = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet docProps = UnoRuntime.queryInterface( XPropertySet.class, xSheetDoc); XSpreadsheets sheets = xSheetDoc.getSheets(); @@ -172,7 +172,7 @@ public class ScDatabaseRangeObj extends TestCase { CellRangeAddress aRange = null; //dbRanges.addNewByName("dbRange", aRange); - XNameAccess dbrNA = (XNameAccess) UnoRuntime.queryInterface( + XNameAccess dbrNA = UnoRuntime.queryInterface( XNameAccess.class, dbRanges); XNamed xNamed = null; @@ -218,7 +218,7 @@ public class ScDatabaseRangeObj extends TestCase { try { Object sheet = sheets.getByName(names[0]); - xCellRange = (XCellRange) UnoRuntime.queryInterface( + xCellRange = UnoRuntime.queryInterface( XCellRange.class, sheet); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java index 915579e496f4..f60cd1638de7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java @@ -104,8 +104,7 @@ public class ScDatabaseRangesObj extends TestCase { log.println( "Creating a test environment" ); log.println("Getting test object ") ; - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); XDatabaseRanges dbRanges = null; try { diff --git a/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java index ea4bf9c9b0ef..77692adb089f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java @@ -104,7 +104,7 @@ public class ScDrawPageObj extends TestCase { try { log.println( "getting Drawpages" ); XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDoc); - oDP = (XDrawPages) oDPS.getDrawPages(); + oDP = oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); oObj = (XDrawPage) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java b/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java index f2ae638a3fb8..f25557e5209a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java @@ -109,7 +109,7 @@ public class ScDrawPagesObj extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpages" ); XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xSheetDoc); - oDP = (XDrawPages) oDPS.getDrawPages(); + oDP = oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); oObj = oDP; diff --git a/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java index 8b8daaab782b..4849bfb02e93 100644 --- a/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java @@ -101,7 +101,7 @@ public class ScFilterDescriptorBase extends TestCase { XSheetFilterable SF = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java b/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java index 85cfc2bad05e..7fdf6c586803 100644 --- a/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java @@ -79,7 +79,7 @@ public class ScFunctionDescriptionObj extends TestCase { XInterface FDs = (XInterface)oDocMSF. createInstance("com.sun.star.sheet.FunctionDescriptions"); - XNameAccess NA = (XNameAccess)UnoRuntime.queryInterface + XNameAccess NA = UnoRuntime.queryInterface (XNameAccess.class, FDs); String names[] = NA.getElementNames(); diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java index af8b1d08cbca..799088ea8c49 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java @@ -151,8 +151,7 @@ public class ScHeaderFieldObj extends TestCase { } //get the property-set - PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java index b87925cdfabb..6d2c59aed099 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java @@ -136,8 +136,7 @@ public class ScHeaderFieldsObj extends TestCase { } //get the property-set - PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java index bbadda64e346..88e01a43d616 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java @@ -122,8 +122,7 @@ public class ScHeaderFooterContentObj extends TestCase { } //get the property-set - PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java index 15be879ddf39..007855f82735 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java @@ -161,8 +161,7 @@ public class ScHeaderFooterTextCursor extends TestCase { } //get the property-set - PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java index 530f54120ed1..a937eadd85ff 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java @@ -165,8 +165,7 @@ public class ScHeaderFooterTextObj extends TestCase { } //get the property-set - PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java index edd2911df097..3d3f6bbf4736 100644 --- a/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java @@ -115,14 +115,14 @@ public class ScImportDescriptorBase extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); if (xSpreadsheets == null) log.println("FAILED"); else log.println("OK"); log.println("getting a sheet"); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); + oObj = UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); } catch (Exception e) { throw new StatusException( "Couldn't get a spreadsheet", e); } diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java index dbf755481643..ee7b609377fb 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java @@ -75,7 +75,7 @@ public class ScIndexEnumeration_CellAnnotationsEnumeration extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java index d63546f09d10..96df8bc1f105 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java @@ -78,14 +78,14 @@ public class ScIndexEnumeration_CellAreaLinksEnumeration extends TestCase { try { // creation of testobject here - XPropertySet props = (XPropertySet)UnoRuntime.queryInterface + XPropertySet props = UnoRuntime.queryInterface (XPropertySet.class, xSheetDoc); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),props.getPropertyValue("AreaLinks")) ; XAreaLinks links = null ; // adding one link into collection (for best testing) - links = (XAreaLinks) UnoRuntime.queryInterface(XAreaLinks.class, oObj) ; + links = UnoRuntime.queryInterface(XAreaLinks.class, oObj) ; CellAddress addr = new CellAddress ((short) 1,2,3) ; String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc"); links.insertAtPosition (addr, aSourceArea, "a2:b5", "", "") ; diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java index 66cb82de4e63..0abfc03285e0 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java @@ -100,7 +100,7 @@ public class ScIndexEnumeration_DDELinksEnumeration extends TestCase { } log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -138,8 +138,7 @@ public class ScIndexEnumeration_DDELinksEnumeration extends TestCase { log.println("Getting test object ") ; // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); oObj = (XInterface)AnyConverter.toObject( new Type(XInterface.class),docProps.getPropertyValue("DDELinks")); log.println("Creating object - " + diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java index 734c735f0e61..dfdd517536d9 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java @@ -83,7 +83,7 @@ public class ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java index 3c2e8d8c5707..e8e5a7b097fd 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java @@ -143,7 +143,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration log.println("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface( @@ -226,7 +226,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration try { Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface( + fieldPropSet = UnoRuntime.queryInterface( XPropertySet.class, oDataPilotField); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(); @@ -332,7 +332,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration if (!name.equals("Data")) { fieldsNames[cnt] = name; - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet props = UnoRuntime.queryInterface( XPropertySet.class, field); try { diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java index be0ae0c276ef..eedc7b1c54f7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java @@ -83,7 +83,7 @@ public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java index 0f0b2854ae0b..900c520bd839 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java @@ -77,8 +77,7 @@ public class ScIndexEnumeration_DatabaseRangesEnumeration extends TestCase { log.println( "Creating a test environment" ); log.println("Getting test object ") ; - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); XDatabaseRanges dbRanges = null; try { diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java index 207a7c427a19..c074fd4e15da 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java @@ -75,8 +75,7 @@ public class ScIndexEnumeration_LabelRangesEnumeration extends TestCase { try { log.println("Getting test object ") ; - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java index 1b3165192202..9d9e2cd83590 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java @@ -76,8 +76,7 @@ public class ScIndexEnumeration_NamedRangesEnumeration extends TestCase { log.println("Getting test object "); // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = null; try { ranges = docProps.getPropertyValue("NamedRanges"); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java index a8bd4f0ab663..4b4960e946b8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java @@ -73,7 +73,7 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); @@ -102,8 +102,7 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { } XScenariosSupplier xSupp = UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); - XCellRange oRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java index 0cdbf4821317..865ed59b8fd3 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java @@ -95,8 +95,7 @@ public class ScIndexEnumeration_SheetCellRangesEnumeration extends TestCase { try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndSheets.getByIndex(0)); - XNameContainer oRanges = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oObj); + XNameContainer oRanges = UnoRuntime.queryInterface(XNameContainer.class, oObj); oRange = oSheet.getCellRangeByName("C1:D4"); oRanges.insertByName("Range1", oRange); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java index 823825791feb..261739ad7ed9 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java @@ -102,8 +102,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { com.sun.star.sheet.SheetLinkMode.VALUE); // Getting links. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object links = null; try { @@ -116,7 +115,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { throw new StatusException("Couldn't get SheetLinks", e); } - oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, links); + oObj = UnoRuntime.queryInterface(XInterface.class, links); XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java index ec6601197b1b..88d9d2c5bb53 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java @@ -65,10 +65,9 @@ public class ScIndexEnumeration_SpreadsheetsEnumeration extends TestCase { protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); - XInterface oObj = (XInterface) - UnoRuntime.queryInterface(XInterface.class, xSpreadsheets); + XInterface oObj = UnoRuntime.queryInterface(XInterface.class, xSpreadsheets); log.println("creating a new environment for object"); XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java index 28e3faef0325..dd7dd1bff5a8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java @@ -77,7 +77,7 @@ public class ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java index dad41188204c..478b4a6c9a9b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java @@ -164,8 +164,7 @@ public class ScIndexEnumeration_TableChartsEnumeration extends TestCase { // insert a chart Rectangle oRect = new Rectangle(500, 3000, 25000, 11000); - XCellRange oRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java index a907f195f65b..f1d2617f8169 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java @@ -78,9 +78,8 @@ public class ScIndexEnumeration_TableColumnsEnumeration extends TestCase { log.println("craeting a test environment"); log.println("getting column"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); XSpreadsheet xSpreadsheet = null; try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( @@ -98,7 +97,7 @@ public class ScIndexEnumeration_TableColumnsEnumeration extends TestCase { } XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); + XTableColumns oColumns = oColumnRowRange.getColumns(); oObj = oColumns; log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java index c457d7ef77eb..841490a987f6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java @@ -77,7 +77,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -111,8 +111,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas XPropertySet Props = null; try { - Props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oSheet); + Props = UnoRuntime.queryInterface(XPropertySet.class, oSheet); CFormat = Props.getPropertyValue("ConditionalFormat"); if (utils.isVoid(CFormat)) { log.println("Property 'ConditionalFormat' is void"); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java index 2c12cd2dc40c..c5f310654bdf 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java @@ -75,9 +75,8 @@ public class ScIndexEnumeration_TableRowsEnumeration extends TestCase { log.println("getting row"); XSpreadsheet xSpreadsheet = null; - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), @@ -95,7 +94,7 @@ public class ScIndexEnumeration_TableRowsEnumeration extends TestCase { XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); + XTableRows oRows = oColumnRowRange.getRows(); oObj = oRows; log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java index babd30b14efe..706caacf8370 100644 --- a/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java @@ -100,8 +100,7 @@ public class ScLabelRangeObj extends TestCase { try { log.println("Getting test object ") ; - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); diff --git a/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java index d9db0e49d36d..3fd45f0c6d27 100644 --- a/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java @@ -103,8 +103,7 @@ public class ScLabelRangesObj extends TestCase { try { log.println("Getting test object ") ; - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); diff --git a/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java index a4dd4a158b7f..4de0b49f3300 100644 --- a/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java @@ -109,8 +109,7 @@ public class ScNamedRangeObj extends TestCase { log.println("Getting test object ") ; // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = null; try { diff --git a/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java index 20e24abd113a..f56e6f3b974d 100644 --- a/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java @@ -128,8 +128,7 @@ public class ScNamedRangesObj extends TestCase { } // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = null; try { ranges = docProps.getPropertyValue("NamedRanges"); diff --git a/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java b/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java index 4e89e744c1dc..f8ebe1b279d9 100644 --- a/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java @@ -111,8 +111,7 @@ public class ScRecentFunctionsObj extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); // Other parameters required for interface tests - XNameAccess NA = (XNameAccess) - UnoRuntime.queryInterface(XNameAccess.class, allFunctions); + XNameAccess NA = UnoRuntime.queryInterface(XNameAccess.class, allFunctions); tEnv.addObjRelation("FUNCTIONLIST", NA); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java b/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java index 6d8668237226..cb1d42219370 100644 --- a/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java @@ -106,7 +106,7 @@ public class ScScenariosObj extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); @@ -135,8 +135,7 @@ public class ScScenariosObj extends TestCase { } XScenariosSupplier xSupp = UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); - XCellRange oRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java index 9658c523cc7c..94cd1fc0a0d6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java @@ -138,8 +138,7 @@ public class ScSheetLinkObj extends TestCase { SL.link(sURL, "Sheet1", "", "", com.sun.star.sheet.SheetLinkMode.VALUE); // Getting links. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object oLinks = null; try { oLinks = docProps.getPropertyValue("SheetLinks"); @@ -151,8 +150,7 @@ public class ScSheetLinkObj extends TestCase { throw new StatusException("Couldn't get SheetLinks", e); } - XNameAccess links = (XNameAccess) - UnoRuntime.queryInterface(XNameAccess.class, oLinks); + XNameAccess links = UnoRuntime.queryInterface(XNameAccess.class, oLinks); String[] names = links.getElementNames(); diff --git a/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java b/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java index 6ff3902346f1..d069c9f42b56 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java @@ -127,8 +127,7 @@ public class ScSheetLinksObj extends TestCase { com.sun.star.sheet.SheetLinkMode.VALUE); // Getting links. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object links = null; try { @@ -141,7 +140,7 @@ public class ScSheetLinksObj extends TestCase { throw new StatusException("Couldn't get SheetLinks", e); } - oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, links); + oObj = UnoRuntime.queryInterface(XInterface.class, links); log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); diff --git a/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java index 936bb8c5ffd9..128aba4a14b1 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java @@ -117,14 +117,14 @@ public class ScSortDescriptorBase extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); if (xSpreadsheets == null) log.println("FAILED"); else log.println("OK"); log.println("getting a sheet"); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); + oObj = UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); } catch (Exception e) { throw new StatusException( "Couldn't get a spreadsheet", e); } diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java index 410535d129db..9e97bd766ceb 100644 --- a/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java @@ -151,9 +151,8 @@ public class ScStyleFamilyObj extends TestCase { SOF.createInstance(xComp,"com.sun.star.style.CellStyle"); // insert a Style which can be replaced by name - XNameContainer oContainer = (XNameContainer) - UnoRuntime.queryInterface( - XNameContainer.class, oStyleFamilyNameAccess); + XNameContainer oContainer = UnoRuntime.queryInterface( + XNameContainer.class, oStyleFamilyNameAccess); try { oContainer.insertByName("ScStyleFamilyObj", oInstance); } catch (com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleObj.java index e5d782628a06..9707e0e567f2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScStyleObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScStyleObj.java @@ -160,9 +160,9 @@ public class ScStyleObj extends TestCase { e.printStackTrace(log); throw new StatusException("Couldn't create instance", e); } - XStyle oMyStyle = (XStyle)UnoRuntime.queryInterface(XStyle.class, oInt); + XStyle oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt); - XNameContainer oStyleFamilyNameContainer = (XNameContainer)UnoRuntime. + XNameContainer oStyleFamilyNameContainer = UnoRuntime. queryInterface(XNameContainer.class, oStyleFamilyNameAccess); try { @@ -208,8 +208,7 @@ public class ScStyleObj extends TestCase { throw new StatusException("Couldn't get spreadsheet by index", e); } - XPropertySet xProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, aCell); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, aCell); try { xProp.setPropertyValue("CellStyle", oMyStyle.getName()); @@ -233,7 +232,7 @@ public class ScStyleObj extends TestCase { tEnv.addObjRelation("PoolStyle", oStyle); tEnv.addObjRelation("PropertyNames", getPropertyNames - ((XPropertySet) UnoRuntime.queryInterface + (UnoRuntime.queryInterface (XPropertySet.class, oMyStyle))); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java index 091d68ad3d80..5139fa458dda 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java @@ -102,7 +102,7 @@ public class ScSubTotalDescriptorBase extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java index 1f5416ab8d99..c6af56ca9ebf 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java @@ -99,7 +99,7 @@ public class ScSubTotalFieldObj extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java index f7fd3415bff5..05d2a2abe717 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java @@ -144,7 +144,7 @@ public class ScTabViewObj extends TestCase { XInterface oObj = aModel.getCurrentController(); log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -181,7 +181,7 @@ public class ScTabViewObj extends TestCase { XCell cell_2 = null; Object cellRange = null; try { - cellRange = (Object)oSheet.getCellRangeByPosition(0, 0, 3, 3); + cellRange = oSheet.getCellRangeByPosition(0, 0, 3, 3); cell_1 = oSheet.getCellByPosition(5,5); cell_2 = oSheet.getCellByPosition(7,7); cell_2.setValue(17.5); @@ -194,7 +194,7 @@ public class ScTabViewObj extends TestCase { Object[] selections = {oSheet, cellRange, cell_1, cell_2}; tEnv.addObjRelation("Selections", selections); - tEnv.addObjRelation("Comparer", new Comparator() { + tEnv.addObjRelation("Comparer", new Comparator<Object>() { public int compare(Object o1, Object o2) { XCellRangeAddressable adr1 = UnoRuntime.queryInterface(XCellRangeAddressable.class, o1); XCellRangeAddressable adr2 = UnoRuntime.queryInterface(XCellRangeAddressable.class, o2); @@ -202,10 +202,7 @@ public class ScTabViewObj extends TestCase { CellRangeAddress range1 = adr1.getRangeAddress(); CellRangeAddress range2 = adr2.getRangeAddress(); return ValueComparer.equalValue(range1, range2) ? 0 : 1 ; - } - public boolean equals(Object obj) { - return compare(this, obj) == 0; - } }); + }}); tEnv.addObjRelation("XUserInputInterception.XModel", aModel); @@ -230,7 +227,7 @@ public class ScTabViewObj extends TestCase { try { log.println( "getting Drawpages" ); XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); - XDrawPages oDP = (XDrawPages) oDPS.getDrawPages(); + XDrawPages oDP = oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); oDrawPage = (XDrawPage) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java b/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java index fd674b3da5ab..68de00f3db29 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java @@ -114,9 +114,8 @@ public class ScTableColumnObj extends TestCase { XSpreadsheet xSpreadsheet = null; - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), @@ -133,7 +132,7 @@ public class ScTableColumnObj extends TestCase { } XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); + XTableColumns oColumns = oColumnRowRange.getColumns(); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oColumns); try { oObj = (XInterface) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java index bdaa454deff5..6f9b9621c9b7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java @@ -107,9 +107,8 @@ public class ScTableColumnsObj extends TestCase { log.println("craeting a test environment"); log.println("getting column"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); XSpreadsheet xSpreadsheet = null; try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( @@ -127,7 +126,7 @@ public class ScTableColumnsObj extends TestCase { } XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); + XTableColumns oColumns = oColumnRowRange.getColumns(); oObj = oColumns; log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java index 5ee191eba153..dbe3d5cca1fc 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java @@ -104,7 +104,7 @@ public class ScTableConditionalEntry extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -138,8 +138,7 @@ public class ScTableConditionalEntry extends TestCase { XPropertySet Props = null; try { - Props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oSheet); + Props = UnoRuntime.queryInterface(XPropertySet.class, oSheet); CFormat = Props.getPropertyValue("ConditionalFormat"); if (utils.isVoid(CFormat)) { log.println("Property 'ConditionalFormat' is void"); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java b/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java index 47b893ad0814..ee764f24f3ef 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java @@ -108,7 +108,7 @@ public class ScTableConditionalFormat extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -137,8 +137,7 @@ public class ScTableConditionalFormat extends TestCase { e.printStackTrace(log); } - XPropertySet Props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oSheet); + XPropertySet Props = UnoRuntime.queryInterface(XPropertySet.class, oSheet); try { oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class), diff --git a/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java b/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java index 91609c52a7f4..9148f1344173 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java @@ -109,16 +109,15 @@ public class ScTableRowObj extends TestCase { log.println("creating a test environment"); XSpreadsheet xSpreadsheet = null; - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), oNames.getByName(oNames.getElementNames()[0])); XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); + XTableRows oRows = oColumnRowRange.getRows(); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oRows); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),oIndexAccess.getByIndex(6)); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java index 4e4f9276b063..15dadb824487 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java @@ -101,9 +101,8 @@ public class ScTableRowsObj extends TestCase { log.println("getting row"); XSpreadsheet xSpreadsheet = null; - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), @@ -121,7 +120,7 @@ public class ScTableRowsObj extends TestCase { XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); + XTableRows oRows = oColumnRowRange.getRows(); oObj = oRows; log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java index 2b053a5c3e8c..0983a263c7b3 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java @@ -187,7 +187,7 @@ public class ScTableSheetObj extends TestCase { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); @@ -227,7 +227,7 @@ public class ScTableSheetObj extends TestCase { throw new StatusException("Exception occurred while filling cells", e); } - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, oSheet); + oObj = UnoRuntime.queryInterface(XInterface.class, oSheet); log.println("creating a new environment for object"); @@ -262,7 +262,7 @@ public class ScTableSheetObj extends TestCase { XSpreadsheet sSheet = null; try { - sSheet = (XSpreadsheet) UnoRuntime.queryInterface( + sSheet = UnoRuntime.queryInterface( XSpreadsheet.class, xSpreadsheets.getByName("Scenario")); } catch (com.sun.star.container.NoSuchElementException e) { @@ -277,7 +277,7 @@ public class ScTableSheetObj extends TestCase { " 'XArrayFormulaRange'"); tEnv.addObjRelation("noArray", "ScTableSheetObj"); - XPropertySet PropSet = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet PropSet = UnoRuntime.queryInterface( XPropertySet.class, oObj); tEnv.addObjRelation("PropSet", PropSet); tEnv.addObjRelation("SHEET", oSheet); @@ -316,7 +316,7 @@ public class ScTableSheetObj extends TestCase { oSheet.getCellByPosition(15, 16) }); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - e.printStackTrace((PrintWriter) log); + e.printStackTrace(log); log.println( "Cannot make required object relation 'XSearchable.MAKEENTRYINCELL'."); } diff --git a/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java index fd2e151c0a73..61b7b72d6b89 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java @@ -112,10 +112,9 @@ public class ScTableSheetsObj extends TestCase { SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF()); log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); - XInterface oObj = (XInterface) - UnoRuntime.queryInterface(XInterface.class, xSpreadsheets); + XInterface oObj = UnoRuntime.queryInterface(XInterface.class, xSpreadsheets); log.println("creating a new environment for object"); TestEnvironment tEnv = new TestEnvironment(oObj); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java b/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java index 8c0c1d6ca6ce..ac071b3c2dd2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java @@ -96,7 +96,7 @@ public class ScTableValidationObj extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -129,8 +129,7 @@ public class ScTableValidationObj extends TestCase { XPropertySet Props = null; try { - Props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oSheet); + Props = UnoRuntime.queryInterface(XPropertySet.class, oSheet); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),Props.getPropertyValue("Validation")); } catch (com.sun.star.lang.WrappedTargetException e){ diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java index f2a37f9fb723..4206440fcaf5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java @@ -77,7 +77,7 @@ public class ScUniqueCellFormatsEnumeration extends TestCase { XIndexAccess.class, xSheetDoc.getSheets()); try { - oSheet = (XSpreadsheet) UnoRuntime.queryInterface( + oSheet = UnoRuntime.queryInterface( XSpreadsheet.class, xIA.getByIndex(0)); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); @@ -114,7 +114,7 @@ public class ScUniqueCellFormatsEnumeration extends TestCase { protected void changeColor(String RangeName, int r, int g, int b) { XCellRange xRange = oSheet.getCellRangeByName(RangeName); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, xRange); Color c = new Color(r, g, b); int c2int = 16777216 + c.hashCode(); diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java index 9d7b706668e9..03e46718d24e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java @@ -76,7 +76,7 @@ public class ScUniqueCellFormatsObj extends TestCase { XIndexAccess.class, xSheetDoc.getSheets()); try { - oSheet = (XSpreadsheet) UnoRuntime.queryInterface( + oSheet = UnoRuntime.queryInterface( XSpreadsheet.class, xIA.getByIndex(0)); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); @@ -108,7 +108,7 @@ public class ScUniqueCellFormatsObj extends TestCase { protected void changeColor(String RangeName, int r, int g, int b) { XCellRange xRange = oSheet.getCellRangeByName(RangeName); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, xRange); Color c = new Color(r, g, b); int c2int = 16777216 + c.hashCode(); diff --git a/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java index bdda48d7ad76..b96da0233a79 100644 --- a/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java @@ -158,7 +158,7 @@ public class ScViewPaneObj extends TestCase { try { log.println( "getting Drawpages" ); XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); - XDrawPages oDP = (XDrawPages) oDPS.getDrawPages(); + XDrawPages oDP = oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); oDrawPage = (XDrawPage) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java index 7793b5d07673..2fde6b2a544d 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java @@ -135,7 +135,7 @@ public class XMLMetaExporter extends TestCase { // Obtaining and changing property values XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xSheetDoc) ; - XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; docInfo.setPropertyValue("Title", "TestDocument"); diff --git a/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java index 30875b90af74..f5df59c92d24 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java @@ -161,7 +161,7 @@ public class XMLMetaImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xSheetDoc) ; - final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + final XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; final PrintWriter logF = log ; diff --git a/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java index a8fba99670ec..599d0f5ec653 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java @@ -128,8 +128,7 @@ public class XMLSettingsExporter extends TestCase { //set some settings XModel xSheetModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xSheetModel.getCurrentController(); - XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); xPropSet.setPropertyValue("ShowGrid", "false"); util.CalcTools.fillCalcSheetWithContent(xSheetDoc, 0, 3, 3, 50, 50); diff --git a/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java index 72218cfb741e..5fadc74e608c 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java @@ -135,8 +135,7 @@ public class XMLSettingsImporter extends TestCase { XModel xSheetModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xSheetModel.getCurrentController(); - xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log) ; throw new StatusException("Can't create component.", e) ; diff --git a/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java index ff310e27d168..ea1c7773a4ad 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java @@ -141,8 +141,7 @@ public class XMLStylesExporter extends TestCase { StyleFamilies.getByName(styleFamiliesNames[0])); Object SC = SOF.createInstance( xSheetDoc, "com.sun.star.style.CellStyle"); - XStyle StyleCell = (XStyle) - UnoRuntime.queryInterface(XStyle.class,SC); + XStyle StyleCell = UnoRuntime.queryInterface(XStyle.class,SC); StyleFamilyName.insertByName(newName, StyleCell); log.println("fill sheet 1 with content..."); diff --git a/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java index a83e770ac51b..0d6ab7d9ae7b 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java @@ -174,7 +174,7 @@ public class XMLStylesImporter extends TestCase { (XStyleFamiliesSupplier.class, xSheetDoc); XNameAccess oStyleFamilies = sup.getStyleFamilies(); Object family = oStyleFamilies.getByName("CellStyles") ; - styles = (XNameAccess) UnoRuntime.queryInterface + styles = UnoRuntime.queryInterface (XNameAccess.class, family) ; log.println("Styles before:") ; String[] names = styles.getElementNames() ; |