diff options
Diffstat (limited to 'qadevOOo/tests/java/mod/_sc')
125 files changed, 493 insertions, 792 deletions
diff --git a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java index 95cc1f36a5a0..9013668a1efe 100644 --- a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java +++ b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java @@ -64,7 +64,7 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolkit); util.utils.shortWait(Param.getInt("ShortWait")); @@ -76,7 +76,7 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { Object atw = tk.getActiveTopWindow(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -98,13 +98,13 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - action = (XAccessibleAction) UnoRuntime.queryInterface( + action = UnoRuntime.queryInterface( XAccessibleAction.class, ok_button); - XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface( + XAccessibleText text = UnoRuntime.queryInterface( XAccessibleText.class, oObj); - XAccessibleEditableText eText = (XAccessibleEditableText) UnoRuntime.queryInterface( + XAccessibleEditableText eText = UnoRuntime.queryInterface( XAccessibleEditableText.class, oObj); @@ -152,7 +152,7 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { try { SOfficeFactory SOF = SOfficeFactory.getFactory(msf); - xCalcDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class, + xCalcDoc = UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc( null)); } catch (com.sun.star.uno.Exception e) { @@ -174,7 +174,7 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { } public void run() { - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel = UnoRuntime.queryInterface(XModel.class, xCalcDoc); XController xController = aModel.getCurrentController(); @@ -182,10 +182,10 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { //Opening HeaderFooterDialog try { String aSlotID = ".uno:EditHeaderAndFooter"; - XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( + XURLTransformer xParser = UnoRuntime.queryInterface( XURLTransformer.class, msf.createInstance( "com.sun.star.util.URLTransformer")); diff --git a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java index 42f7b5b5cb99..ac90e5bd70ba 100644 --- a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java +++ b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java @@ -74,7 +74,7 @@ public class AccessibleEditableTextPara_PreviewCell extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent)UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -92,8 +92,7 @@ public class AccessibleEditableTextPara_PreviewCell extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -115,18 +114,15 @@ public class AccessibleEditableTextPara_PreviewCell extends TestCase { xCell.setFormula("Value"); - XModel xModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xModel.getCurrentController(); //switch to 'Print Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); aParseURL[0].Complete = ".uno:PrintPreview"; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java index 7d8b914cffff..743e8388cee6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java @@ -102,8 +102,7 @@ public class ScAccessibleCell extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XWindow xWindow = AccessibilityTools.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -120,8 +119,7 @@ public class ScAccessibleCell extends TestCase { final String text = "XAccessibleText"; try { XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = null; try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -131,11 +129,9 @@ public class ScAccessibleCell extends TestCase { } xCell = oSheet.getCellByPosition(1, 0) ; xCell.setFormula(text); - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, oSheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, oSheet); XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oColumns); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oColumns); XPropertySet column = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class,oIndexAccess.getByIndex(1)); column.setPropertyValue("OptimalWidth", new Boolean(true)); @@ -184,8 +180,7 @@ public class ScAccessibleCell extends TestCase { */ protected void cleanup( TestParameters Param, PrintWriter log) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java index 72312dc9167f..4c3e6bf97e66 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java @@ -72,11 +72,9 @@ public class ScAccessibleCsvCell extends TestCase { } - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); - XWindow xWindow = (XWindow) - UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -84,15 +82,14 @@ public class ScAccessibleCsvCell extends TestCase { oObj = AccessibilityTools.getAccessibleObjectForRole (xRoot, AccessibleRole.PUSH_BUTTON, "Cancel"); - accAction = (XAccessibleAction) UnoRuntime.queryInterface(XAccessibleAction.class, oObj); + accAction = UnoRuntime.queryInterface(XAccessibleAction.class, oObj); oObj = AccessibilityTools.getAccessibleObjectForRole (xRoot, AccessibleRole.TABLE, true); //util.dbg.printInterfaces(oObj); - XAccessibleContext cont = (XAccessibleContext) - UnoRuntime.queryInterface(XAccessibleContext.class, oObj); + XAccessibleContext cont = UnoRuntime.queryInterface(XAccessibleContext.class, oObj); String name = ""; try { diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java index 5b05d2857276..68bfad242f14 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java @@ -72,19 +72,17 @@ public class ScAccessibleCsvGrid extends TestCase { } - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); - XWindow xWindow = (XWindow) - UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); oObj = AccessibilityTools.getAccessibleObjectForRole (xRoot, AccessibleRole.PUSH_BUTTON, "Cancel"); - accAction = (XAccessibleAction) UnoRuntime.queryInterface(XAccessibleAction.class, oObj); + accAction = UnoRuntime.queryInterface(XAccessibleAction.class, oObj); /*int count = accAction.getAccessibleActionCount(); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java index aafb0ecdc0f9..76650681f007 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java @@ -74,10 +74,10 @@ public class ScAccessibleCsvRuler extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -85,7 +85,7 @@ public class ScAccessibleCsvRuler extends TestCase { oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Cancel"); - accAction = (XAccessibleAction) UnoRuntime.queryInterface( + accAction = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); XAccessibleContext acc = AccessibilityTools.getAccessibleObjectForRole(xRoot, @@ -93,7 +93,7 @@ public class ScAccessibleCsvRuler extends TestCase { log.println("Click on: " + acc.getAccessibleName()); - XAccessibleAction accAction2 = (XAccessibleAction) UnoRuntime.queryInterface( + XAccessibleAction accAction2 = UnoRuntime.queryInterface( XAccessibleAction.class, acc); try { @@ -114,7 +114,7 @@ public class ScAccessibleCsvRuler extends TestCase { tEnv.addObjRelation("EditOnly", "This method isn't supported in this dialog"); - XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface( + XAccessibleText text = UnoRuntime.queryInterface( XAccessibleText.class, oObj); int lastone = 100; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java index e16ed229db11..9b29d9e4bc08 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java @@ -83,8 +83,7 @@ public class ScAccessibleDocument extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpages" ); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); AccessibilityTools at = new AccessibilityTools(); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java index 2dc64ba5da0e..645a05a3fa96 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java @@ -92,8 +92,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { XCell xCell = null; try { XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = null; try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -128,18 +127,15 @@ public class ScAccessibleDocumentPagePreview extends TestCase { e.printStackTrace(log); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XController xController = aModel.getCurrentController(); // switching to 'Page Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); @@ -171,7 +167,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - XDesktop desk = (XDesktop) UnoRuntime.queryInterface( + XDesktop desk = UnoRuntime.queryInterface( XDesktop.class,util.DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF())); final XWindow win = desk.getCurrentFrame().getComponentWindow(); @@ -197,8 +193,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { */ protected void cleanup( TestParameters Param, PrintWriter log) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -220,7 +215,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { log.println("creating a spreadsheetdocument"); String url = utils.getFullTestURL("calcshapes.sxc"); log.println("loading document "+url); - xSpreadsheetDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface( + xSpreadsheetDoc = UnoRuntime.queryInterface( XSpreadsheetDocument.class,SOF.loadDocument(url)); try { Thread.sleep(500); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java index ee521f78ff5b..548b7b94e72e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java @@ -96,8 +96,7 @@ public class ScAccessiblePageHeader extends TestCase { XCell xCell = null; try { XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = null; try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -115,18 +114,15 @@ public class ScAccessiblePageHeader extends TestCase { e.printStackTrace(log); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XController xController = aModel.getCurrentController(); // switching to 'Page Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); @@ -158,10 +154,9 @@ public class ScAccessiblePageHeader extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); XStyle StdStyle = null; @@ -240,8 +235,7 @@ public class ScAccessiblePageHeader extends TestCase { protected void cleanup( TestParameters Param, PrintWriter log) { log.println( " disposing xSheetDoc " ); try { - XCloseable oComp = (XCloseable) - UnoRuntime.queryInterface (XCloseable.class, xSpreadsheetDoc) ; + XCloseable oComp = UnoRuntime.queryInterface (XCloseable.class, xSpreadsheetDoc) ; oComp.close(true); } catch(com.sun.star.util.CloseVetoException e) { log.println("Couldn't close document: "+e.getMessage()); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java index 02a57d6bbabd..a334b7c1f30e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java @@ -93,8 +93,7 @@ public class ScAccessiblePageHeaderArea extends TestCase { XCell xCell = null; try { XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); xCell = oSheet.getCellByPosition(0, 0) ; @@ -110,18 +109,15 @@ public class ScAccessiblePageHeaderArea extends TestCase { e.printStackTrace(log); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XController xController = aModel.getCurrentController(); // switching to 'Page Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); @@ -148,8 +144,7 @@ public class ScAccessiblePageHeaderArea extends TestCase { try { oObj = at.getAccessibleObjectForRole (xRoot, AccessibleRole.HEADER, "").getAccessibleChild(0); - XAccessibleContext cont = (XAccessibleContext) - UnoRuntime.queryInterface(XAccessibleContext.class, oObj); + XAccessibleContext cont = UnoRuntime.queryInterface(XAccessibleContext.class, oObj); XAccessibleStateSet StateSet = cont.getAccessibleStateSet(); if (StateSet.contains((short)27)) { log.println("Object is transient"); @@ -166,8 +161,7 @@ public class ScAccessiblePageHeaderArea extends TestCase { XAccessibleContext zoomIn = at.getAccessibleObjectForRole(xRoot,AccessibleRole.PUSH_BUTTON, "Zoom In"); - final XAccessibleAction pressZoom = (XAccessibleAction) - UnoRuntime.queryInterface(XAccessibleAction.class, zoomIn); + final XAccessibleAction pressZoom = UnoRuntime.queryInterface(XAccessibleAction.class, zoomIn); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { @@ -191,8 +185,7 @@ public class ScAccessiblePageHeaderArea extends TestCase { protected void cleanup( TestParameters Param, PrintWriter log) { log.println( " disposing xSheetDoc " ); try { - XCloseable oComp = (XCloseable) - UnoRuntime.queryInterface (XCloseable.class, xSpreadsheetDoc) ; + XCloseable oComp = UnoRuntime.queryInterface (XCloseable.class, xSpreadsheetDoc) ; oComp.close(true); }catch(com.sun.star.util.CloseVetoException e) { log.println("Couldn't close document: "+e.getMessage()); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java index f96dec4c849d..93565d80ec77 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java @@ -98,7 +98,7 @@ public class ScAccessiblePreviewCell extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent)UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -116,8 +116,7 @@ public class ScAccessiblePreviewCell extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -139,18 +138,15 @@ public class ScAccessiblePreviewCell extends TestCase { xCell.setFormula("Value"); - XModel xModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xModel.getCurrentController(); //switch to 'Print Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); aParseURL[0].Complete = ".uno:PrintPreview"; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java index 39e755afa0ec..34f86a372354 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java @@ -96,7 +96,7 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { if (xSheetDoc != null) { try { - XCloseable oComp = (XCloseable) UnoRuntime.queryInterface( + XCloseable oComp = UnoRuntime.queryInterface( XCloseable.class, xSheetDoc); oComp.close(true); xSheetDoc = null; @@ -121,7 +121,7 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { XInterface oObj = null; if (xSheetDoc != null) { - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -137,7 +137,7 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { throw new StatusException("Couldn't create document", e); } - XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel xModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xModel.getCurrentController(); @@ -149,7 +149,7 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { log.println("Getting spreadsheet"); XSpreadsheets oSheets = xSheetDoc.getSheets(); - XIndexAccess oIndexSheets = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexSheets = UnoRuntime.queryInterface( XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), @@ -174,7 +174,7 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { xCell.setFormula("Value"); //setting property 'PrintHeaders' of the style 'Default' - XStyleFamiliesSupplier xSFS = (XStyleFamiliesSupplier) UnoRuntime.queryInterface( + XStyleFamiliesSupplier xSFS = UnoRuntime.queryInterface( XStyleFamiliesSupplier.class, xSheetDoc); XNameAccess xNA = xSFS.getStyleFamilies(); @@ -218,10 +218,10 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { //switching to 'Print Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( + XURLTransformer xParser = UnoRuntime.queryInterface( XURLTransformer.class, ( (XMultiServiceFactory) Param.getMSF()) .createInstance("com.sun.star.util.URLTransformer")); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java index 899a8950c394..9560d4628ea2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java @@ -101,7 +101,7 @@ public class ScAccessiblePreviewTable extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent)UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -119,8 +119,7 @@ public class ScAccessiblePreviewTable extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -142,18 +141,15 @@ public class ScAccessiblePreviewTable extends TestCase { xCell.setFormula("Value"); - XModel xModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xModel.getCurrentController(); //switch to 'Print Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); aParseURL[0].Complete = ".uno:PrintPreview"; @@ -189,8 +185,7 @@ public class ScAccessiblePreviewTable extends TestCase { log.println("Getting "+ zoomIn.getAccessibleName()); - final XAccessibleAction pressZoom = (XAccessibleAction) - UnoRuntime.queryInterface(XAccessibleAction.class, zoomIn); + final XAccessibleAction pressZoom = UnoRuntime.queryInterface(XAccessibleAction.class, zoomIn); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java index 748116e91526..9e1d545cf579 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java @@ -89,7 +89,7 @@ public class ScAccessibleSpreadsheet extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent)UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -105,8 +105,7 @@ public class ScAccessibleSpreadsheet extends TestCase { XInterface oObj = null; - XModel xModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); AccessibilityTools at = new AccessibilityTools(); @@ -126,8 +125,7 @@ public class ScAccessibleSpreadsheet extends TestCase { final String text = "Text for testing of the interface XAccessibleText"; try { XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); xCell = oSheet.getCellByPosition(5, 5) ; diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java index 7642e33e4958..2cc6362caf6b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java @@ -87,7 +87,7 @@ public class ScAnnotationObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -122,12 +122,10 @@ public class ScAnnotationObj extends TestCase { log.println("Getting test object ") ; - XSpreadsheetDocument xArea = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xArea = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); - XIndexAccess XAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess XAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCell oCell = null; try { XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -149,8 +147,7 @@ public class ScAnnotationObj extends TestCase { "Error getting test object from spreadsheet document",e); } - XSheetAnnotationAnchor oAnnoA = (XSheetAnnotationAnchor) - UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); + XSheetAnnotationAnchor oAnnoA = UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); XSheetAnnotation oAnno = oAnnoA.getAnnotation(); oObj = oAnno; diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java index e3b57c735c52..c3f8ba5e1ba7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java @@ -84,7 +84,7 @@ public class ScAnnotationShapeObj extends TestCase { log.println("Loading: "+utils.getFullTestURL( "ScAnnotationShapeObj.sxc")); xSheetDoc = - (XSpreadsheetDocument) UnoRuntime.queryInterface(XSpreadsheetDocument.class, + UnoRuntime.queryInterface(XSpreadsheetDocument.class, SOF.loadDocument(utils.getFullTestURL( "ScAnnotationShapeObj.sxc"))); } catch (com.sun.star.uno.Exception e) { @@ -101,8 +101,8 @@ public class ScAnnotationShapeObj extends TestCase { log.println(" disposing xSheetDoc "); XComponent oComp = - (XComponent) UnoRuntime.queryInterface(XComponent.class, - xSheetDoc); + UnoRuntime.queryInterface(XComponent.class, + xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -133,13 +133,13 @@ public class ScAnnotationShapeObj extends TestCase { log.println("Getting test object "); XSpreadsheetDocument xArea = - (XSpreadsheetDocument) UnoRuntime.queryInterface(XSpreadsheetDocument.class, - xSheetDoc); + UnoRuntime.queryInterface(XSpreadsheetDocument.class, + xSheetDoc); XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); XIndexAccess XAccess = - (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, - oSheets); + UnoRuntime.queryInterface(XIndexAccess.class, + oSheets); XCell oCell = null; try { @@ -167,18 +167,18 @@ public class ScAnnotationShapeObj extends TestCase { } XSheetAnnotationAnchor oAnnoA = - (XSheetAnnotationAnchor) UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, - oCell); + UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, + oCell); XSheetAnnotation oAnno = oAnnoA.getAnnotation(); XSimpleText xAnnoText = - (XSimpleText) UnoRuntime.queryInterface(XSimpleText.class, - oAnno); + UnoRuntime.queryInterface(XSimpleText.class, + oAnno); xAnnoText.setString("ScAnnotationShapeObj"); XSheetAnnotationShapeSupplier xSheetAnnotationShapeSupplier = - (XSheetAnnotationShapeSupplier) UnoRuntime.queryInterface(XSheetAnnotationShapeSupplier.class, - oAnno); + UnoRuntime.queryInterface(XSheetAnnotationShapeSupplier.class, + oAnno); oObj = xSheetAnnotationShapeSupplier.getAnnotationShape(); diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java index c4b44c982298..bbb2f12bc65b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java @@ -78,7 +78,7 @@ public class ScAnnotationTextCursor extends TestCase { protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -102,13 +102,11 @@ public class ScAnnotationTextCursor extends TestCase { try { log.println("Getting test object ") ; - XSpreadsheetDocument xArea = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xArea = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); - XIndexAccess XAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess XAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet)XAccess.getByIndex(cellPos.Sheet); @@ -117,12 +115,10 @@ public class ScAnnotationTextCursor extends TestCase { XCell oCell = oCRange.getCellByPosition(cellPos.Column, cellPos.Row); - XSheetAnnotationAnchor oAnnoA = (XSheetAnnotationAnchor) - UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); + XSheetAnnotationAnchor oAnnoA = UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); XSheetAnnotation oAnno = oAnnoA.getAnnotation(); - XSimpleText aText = (XSimpleText) - UnoRuntime.queryInterface(XSimpleText.class,oAnno); + XSimpleText aText = UnoRuntime.queryInterface(XSimpleText.class,oAnno); aText.setString("A nice little Test"); oObj = aText.createTextCursor(); diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java index 3ad9076be7f7..c341d016c67e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java @@ -88,8 +88,7 @@ public class ScAnnotationsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -110,8 +109,7 @@ public class ScAnnotationsObj extends TestCase { log.println("Getting test object ") ; - XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xSpreadsheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); XSpreadsheets sheets = (XSpreadsheets) xSpreadsheetDoc.getSheets(); XNameAccess oNames = (XNameAccess) @@ -144,16 +142,13 @@ public class ScAnnotationsObj extends TestCase { "Error getting test object from spreadsheet document",e) ; } - XSheetAnnotationAnchor oAnnoA = (XSheetAnnotationAnchor) - UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); + XSheetAnnotationAnchor oAnnoA = UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); XSheetAnnotation oAnno = oAnnoA.getAnnotation(); - XSimpleText sText = ((XSimpleText) - UnoRuntime.queryInterface(XSimpleText.class, oAnno)); + XSimpleText sText = UnoRuntime.queryInterface(XSimpleText.class, oAnno); sText.setString("ScAnnotationsObj"); - XSheetAnnotationsSupplier supp = (XSheetAnnotationsSupplier) - UnoRuntime.queryInterface( - XSheetAnnotationsSupplier.class, oSheet); + XSheetAnnotationsSupplier supp = UnoRuntime.queryInterface( + XSheetAnnotationsSupplier.class, oSheet); oObj = supp.getAnnotations(); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java index 4e47887791c2..002ca496ccac 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java @@ -87,7 +87,7 @@ public class ScAreaLinkObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java b/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java index 0a73858c7828..45bae04e30f0 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java @@ -83,7 +83,7 @@ public class ScAreaLinksObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java index 5f1e85a1924b..1e7ccb439711 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java @@ -74,11 +74,11 @@ public class ScAutoFormatFieldObj extends TestCase { // creation of testobject here XInterface formats = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance ("com.sun.star.sheet.TableAutoFormats"); - XIndexAccess formatsIndex = (XIndexAccess)UnoRuntime.queryInterface + XIndexAccess formatsIndex = UnoRuntime.queryInterface (XIndexAccess.class, formats); XInterface format = (XInterface) AnyConverter.toObject( new Type(XInterface.class),formatsIndex.getByIndex(0)); - XIndexAccess formatIndex = (XIndexAccess) UnoRuntime.queryInterface + XIndexAccess formatIndex = UnoRuntime.queryInterface (XIndexAccess.class, format); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),formatIndex.getByIndex(0)); diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java index 1e31eb197345..411334cf5e2f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java @@ -78,14 +78,12 @@ public class ScAutoFormatObj extends TestCase { try { XInterface formats = (XInterface)oMSF.createInstance ("com.sun.star.sheet.TableAutoFormats"); - XIndexAccess formatsIndex = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, formats); + XIndexAccess formatsIndex = UnoRuntime.queryInterface(XIndexAccess.class, formats); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),formatsIndex.getByIndex (formatsIndex.getCount() - 1)); - XNamed objNamed = (XNamed) - UnoRuntime.queryInterface(XNamed.class, oObj) ; + XNamed objNamed = UnoRuntime.queryInterface(XNamed.class, oObj) ; log.println("AutoFormat name is '" + objNamed.getName() + "'") ; } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java index 3b9b634be40b..58c0510b30e8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java @@ -83,7 +83,7 @@ public class ScAutoFormatsObj extends TestCase{ */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -111,7 +111,7 @@ public class ScAutoFormatsObj extends TestCase{ try { // creation of testobject here // get AutoFormats - XComponent xComp = (XComponent)UnoRuntime.queryInterface + XComponent xComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),((XMultiServiceFactory)Param.getMSF()).createInstance diff --git a/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java b/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java index 270018c1afda..a9a732ac16dd 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java @@ -123,7 +123,7 @@ public class ScCellCursorObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); @@ -156,9 +156,9 @@ public class ScCellCursorObj extends TestCase { // first we write what we are intend to do to log file log.println("Creating a test environment"); - XSpreadsheets oSpreadsheets = ((XSpreadsheetDocument) UnoRuntime.queryInterface( + XSpreadsheets oSpreadsheets = UnoRuntime.queryInterface( XSpreadsheetDocument.class, - xSheetDoc)).getSheets(); + xSheetDoc).getSheets(); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -168,7 +168,7 @@ public class ScCellCursorObj extends TestCase { testRange = oSheet.getCellRangeByName("$A$1:$D$4"); - XSheetCellRange testSheetRange = (XSheetCellRange) UnoRuntime.queryInterface( + XSheetCellRange testSheetRange = UnoRuntime.queryInterface( XSheetCellRange.class, testRange); oObj = oSheet.createCursorByRange(testSheetRange); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java index edfb5437bf61..2d9cfaf9508a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java @@ -88,8 +88,7 @@ public class ScCellFieldObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -123,8 +122,7 @@ public class ScCellFieldObj extends TestCase { // we want to create an instance of ScCellFieldObj. // to do this we must get an MultiServiceFactory. - XMultiServiceFactory _oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); + XMultiServiceFactory _oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); // Now create the instance of com.sun.star.text.TextField. // This object has type ScCellFieldObj. @@ -134,26 +132,23 @@ public class ScCellFieldObj extends TestCase { aField = (XInterface) _oMSF.createInstance("com.sun.star.text.TextField.URL"); - oContent = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, aField); + oContent = UnoRuntime.queryInterface(XTextContent.class, aField); XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); XCell oCell = oSheet.getCellByPosition(2,3); - oText = (XText)UnoRuntime.queryInterface(XText.class, oCell); + oText = UnoRuntime.queryInterface(XText.class, oCell); - XTextContent oTextContent = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oObj); + XTextContent oTextContent = UnoRuntime.queryInterface(XTextContent.class, oObj); oText.insertTextContent( oText.createTextCursor(), oTextContent, true); oCell = oSheet.getCellByPosition(1,4); - oText = (XText)UnoRuntime.queryInterface(XText.class, oCell); + oText = UnoRuntime.queryInterface(XText.class, oCell); } catch (com.sun.star.lang.WrappedTargetException e) { log.println("Exception occurred while creating test Object."); e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java index 389e327c39ca..e02dbc6d9dd3 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java @@ -83,8 +83,7 @@ public class ScCellFieldsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -107,28 +106,24 @@ public class ScCellFieldsObj extends TestCase { // we want to create an instance of ScCellFieldObj. // to do this we must get an MultiServiceFactory. - XMultiServiceFactory _oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); + XMultiServiceFactory _oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); aField = (XInterface) _oMSF.createInstance("com.sun.star.text.TextField.URL"); - oContent = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, aField); + oContent = UnoRuntime.queryInterface(XTextContent.class, aField); XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); XCell oCell = oSheet.getCellByPosition(2,3); - oText = (XText)UnoRuntime.queryInterface(XText.class, oCell); + oText = UnoRuntime.queryInterface(XText.class, oCell); oText.insertTextContent( oText.createTextCursor(), oContent, true); - XTextFieldsSupplier xTextFieldsSupp = (XTextFieldsSupplier) - UnoRuntime.queryInterface(XTextFieldsSupplier.class, oCell); + XTextFieldsSupplier xTextFieldsSupp = UnoRuntime.queryInterface(XTextFieldsSupplier.class, oCell); oObj = xTextFieldsSupp.getTextFields(); } catch (com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java index 493a4d884ded..8aa19354cff7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java @@ -75,8 +75,7 @@ public class ScCellFormatsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -108,8 +107,7 @@ public class ScCellFormatsEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -127,13 +125,11 @@ public class ScCellFormatsEnumeration extends TestCase { log.println("getting CellFormats"); - XCellFormatRangesSupplier xCFRS = (XCellFormatRangesSupplier) - UnoRuntime.queryInterface(XCellFormatRangesSupplier.class,oSheet); + XCellFormatRangesSupplier xCFRS = UnoRuntime.queryInterface(XCellFormatRangesSupplier.class,oSheet); XIndexAccess formats = xCFRS.getCellFormatRanges(); log.println("getting Enumeration"); - XEnumerationAccess oEnum = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,formats); + XEnumerationAccess oEnum = UnoRuntime.queryInterface(XEnumerationAccess.class,formats); oObj = oEnum.createEnumeration(); log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java index 0e68d501fb80..c6ffccbd1160 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java @@ -77,8 +77,7 @@ public class ScCellFormatsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -100,8 +99,7 @@ public class ScCellFormatsObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -117,8 +115,7 @@ public class ScCellFormatsObj extends TestCase { } log.println("getting CellFormats"); - XCellFormatRangesSupplier xCFRS = (XCellFormatRangesSupplier) - UnoRuntime.queryInterface(XCellFormatRangesSupplier.class, oSheet); + XCellFormatRangesSupplier xCFRS = UnoRuntime.queryInterface(XCellFormatRangesSupplier.class, oSheet); XIndexAccess formats = xCFRS.getCellFormatRanges(); oObj = formats; diff --git a/qadevOOo/tests/java/mod/_sc/ScCellObj.java b/qadevOOo/tests/java/mod/_sc/ScCellObj.java index a210e0b63615..51e85aa9006e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellObj.java @@ -104,8 +104,7 @@ public class ScCellObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -134,14 +133,13 @@ public class ScCellObj extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); log.println("Getting a cell from sheet") ; oObj = oSheet.getCellByPosition(2, 3) ; - cell = (XCell)UnoRuntime.queryInterface(XCell.class, oObj); + cell = UnoRuntime.queryInterface(XCell.class, oObj); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java index 1a84654b24e3..c16d4fff4761 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java @@ -110,7 +110,7 @@ public class ScCellRangeObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -139,9 +139,9 @@ public class ScCellRangeObj extends TestCase { // first we write what we are intend to do to log file log.println("Creating a test environment"); - XSpreadsheets oSpreadsheets = ((XSpreadsheetDocument) UnoRuntime.queryInterface( + XSpreadsheets oSpreadsheets = UnoRuntime.queryInterface( XSpreadsheetDocument.class, - xSheetDoc)).getSheets(); + xSheetDoc).getSheets(); XNameAccess oNames = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, oSpreadsheets); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java index 703592c5fcc7..e50a26489464 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java @@ -109,7 +109,7 @@ public class ScCellRangesObj extends TestCase { protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); XComponent oComp = - (XComponent) UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -145,15 +145,13 @@ public class ScCellRangesObj extends TestCase { log.println("Getting test object "); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); oObj = (XInterface) SOF.createInstance(oComp, "com.sun.star.sheet.SheetCellRanges"); XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndSheets = (XIndexAccess) - UnoRuntime.queryInterface (XIndexAccess.class, oSheets); + XIndexAccess oIndSheets = UnoRuntime.queryInterface (XIndexAccess.class, oSheets); XSpreadsheet oSheet = null; try { oSheet = (XSpreadsheet) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java b/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java index 10377ca55393..1708d297bced 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java @@ -84,8 +84,7 @@ public class ScCellSearchObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -111,8 +110,7 @@ public class ScCellSearchObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -128,8 +126,7 @@ public class ScCellSearchObj extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - XSearchable xSearch = (XSearchable) - UnoRuntime.queryInterface(XSearchable.class,oSheet); + XSearchable xSearch = UnoRuntime.queryInterface(XSearchable.class,oSheet); oObj = xSearch.createSearchDescriptor(); // create testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java index 06e560026ed6..3632ce344116 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java @@ -113,8 +113,7 @@ public class ScCellTextCursor extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -147,8 +146,7 @@ public class ScCellTextCursor extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -169,7 +167,7 @@ public class ScCellTextCursor extends TestCase { "Error getting cell object from spreadsheet document",e) ; } - XText aText = (XText) UnoRuntime.queryInterface(XText.class, aCell); + XText aText = UnoRuntime.queryInterface(XText.class, aCell); aText.setString("ScCellTextCursor"); oObj = aText.createTextCursor(); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java index 8c9664746085..7547e35cb464 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java @@ -77,8 +77,7 @@ public class ScCellsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -109,24 +108,21 @@ public class ScCellsEnumeration extends TestCase { // creation of testobject here XSpreadsheets oSheets = (XSpreadsheets)xSheetDoc.getSheets(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + 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); - XTextRange oTextRange = (XTextRange) - UnoRuntime.queryInterface(XTextRange.class, oCell_1); + XTextRange oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_1); oTextRange.setString("Test string 1"); XCell oCell_2 = (XCell)oSheet.getCellByPosition(5, 1); oCell_2.setValue(15); XCell oCell_3 = (XCell)oSheet.getCellByPosition(3, 9); - oTextRange = (XTextRange) - UnoRuntime.queryInterface(XTextRange.class, oCell_3); + oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_3); oTextRange.setString("test 2"); cellArr[0] = oCell_1; cellArr[1] = oCell_2; @@ -145,8 +141,7 @@ public class ScCellsEnumeration extends TestCase { throw new StatusException("Couldn't create test object", e); } - XCellRangesQuery oCellRangesQuery = (XCellRangesQuery) - UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet); + XCellRangesQuery oCellRangesQuery = UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet); XSheetCellRanges oSheetCellRanges = oCellRangesQuery.queryVisibleCells(); oEnum = (XEnumerationAccess) oSheetCellRanges.getCells(); oObj = oSheetCellRanges.getCells().createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellsObj.java index 084e70d24072..33efd3dd4916 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellsObj.java @@ -81,8 +81,7 @@ public class ScCellsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -103,16 +102,14 @@ public class ScCellsObj extends TestCase { // creation of testobject here XSpreadsheets oSheets = (XSpreadsheets)xSheetDoc.getSheets(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + 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); - XTextRange oTextRange = (XTextRange) - UnoRuntime.queryInterface(XTextRange.class, oCell_1); + XTextRange oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_1); oTextRange.setString("ScCellsObj test 1"); @@ -120,8 +117,7 @@ public class ScCellsObj extends TestCase { oCell_2.setValue(15); XCell oCell_3 = (XCell)oSheet.getCellByPosition(3, 9); - oTextRange = (XTextRange) - UnoRuntime.queryInterface(XTextRange.class, oCell_3); + oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_3); oTextRange.setString("ScCellsObj test 2"); @@ -142,8 +138,7 @@ public class ScCellsObj extends TestCase { throw new StatusException("Couldn't create test object", e); } - XCellRangesQuery oCellRangesQuery = (XCellRangesQuery) - UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet); + XCellRangesQuery oCellRangesQuery = UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet); XSheetCellRanges oSheetCellRanges = oCellRangesQuery.queryVisibleCells(); oObj = oSheetCellRanges.getCells(); diff --git a/qadevOOo/tests/java/mod/_sc/ScChartObj.java b/qadevOOo/tests/java/mod/_sc/ScChartObj.java index 8473bd436bf5..a68749b44f9e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScChartObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScChartObj.java @@ -87,8 +87,7 @@ public class ScChartObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -114,8 +113,7 @@ public class ScChartObj extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); } catch (com.sun.star.lang.WrappedTargetException e) { @@ -202,14 +200,12 @@ public class ScChartObj extends TestCase { XCellRange oRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); - XCellRangeAddressable oRangeAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); CellRangeAddress[] oAddr = new CellRangeAddress[1]; oAddr[0] = myAddr; - XTableChartsSupplier oSupp = (XTableChartsSupplier) - UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); + XTableChartsSupplier oSupp = UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); log.println("Insert Chart"); diff --git a/qadevOOo/tests/java/mod/_sc/ScChartsObj.java b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java index 2ea878bed22c..baf429e8ef3f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScChartsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java @@ -88,8 +88,7 @@ public class ScChartsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -122,8 +121,7 @@ public class ScChartsObj extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); } catch (com.sun.star.lang.WrappedTargetException e) { @@ -209,14 +207,12 @@ public class ScChartsObj extends TestCase { XCellRange oRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); - XCellRangeAddressable oRangeAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); CellRangeAddress[] oAddr = new CellRangeAddress[1]; oAddr[0] = myAddr; - XTableChartsSupplier oSupp = (XTableChartsSupplier) - UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); + XTableChartsSupplier oSupp = UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); log.println("Insert Chart"); diff --git a/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java b/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java index f31608b2da01..c505bd95ec51 100644 --- a/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java +++ b/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java @@ -69,8 +69,7 @@ public class ScConsolidationDescriptor extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -92,8 +91,7 @@ public class ScConsolidationDescriptor extends TestCase { // first we write what we are intend to do to log file log.println( "creating a test environment" ); - XConsolidatable xConsolidate = (XConsolidatable) - UnoRuntime.queryInterface(XConsolidatable.class, xSheetDoc); + XConsolidatable xConsolidate = UnoRuntime.queryInterface(XConsolidatable.class, xSheetDoc); oObj = xConsolidate.createConsolidationDescriptor(true); // create testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java b/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java index c79ae7f6902d..5c7767ece6d3 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java @@ -85,8 +85,7 @@ public class ScDDELinkObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); if (oDoc != null) { util.DesktopTools.closeDoc(oDoc); @@ -155,8 +154,7 @@ public class ScDDELinkObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); diff --git a/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java b/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java index 1be07a968bd1..f2490f3f2bd8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java @@ -83,7 +83,7 @@ public class ScDDELinksObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime. + XComponent oComp = UnoRuntime. queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); util.DesktopTools.closeDoc(oDoc); @@ -134,8 +134,7 @@ public class ScDDELinksObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java index 8d89b7e6eba6..df2b4a5cc841 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java @@ -87,7 +87,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase { log.println (" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface ( + XComponent oComp = UnoRuntime.queryInterface ( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc (oComp); } @@ -122,7 +122,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface ( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -215,7 +215,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase // create the test objects log.println ("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface ( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface ( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables (); @@ -278,11 +278,11 @@ public class ScDataPilotFieldGroupItemObj extends TestCase } DPT.insertNewByName ("DataPilotTable", sCellAdress, DPDsc); - XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + XIndexAccess xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); XIndexAccess IA = null; try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); //getSRange(IA); System.out.println ("COUNT: "+IA.getCount ()); @@ -307,14 +307,14 @@ public class ScDataPilotFieldGroupItemObj extends TestCase try { - XDataPilotFieldGrouping dpfg = (XDataPilotFieldGrouping) UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); + XDataPilotFieldGrouping dpfg = UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); String[] elements = new String[]{"aName","otherName"}; dpfg.createNameGroup (elements); DataPilotFieldGroupInfo dpgi=null; - xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); } catch (com.sun.star.lang.WrappedTargetException e) @@ -335,13 +335,13 @@ public class ScDataPilotFieldGroupItemObj extends TestCase if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); - XNamed xNamed = (XNamed) UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); + XNamed xNamed = UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); System.out.println ("name: "+xNamed.getName ()); dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo"); } } groups = dpgi.Groups; - XIndexAccess groupAccess = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, 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")); } diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java index d104ef2b6fc2..7f650e391669 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java @@ -86,7 +86,7 @@ public class ScDataPilotFieldGroupObj extends TestCase { log.println (" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface ( + XComponent oComp = UnoRuntime.queryInterface ( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc (oComp); } @@ -121,7 +121,7 @@ public class ScDataPilotFieldGroupObj extends TestCase XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface ( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -214,7 +214,7 @@ public class ScDataPilotFieldGroupObj extends TestCase // create the test objects log.println ("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface ( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface ( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables (); @@ -277,11 +277,11 @@ public class ScDataPilotFieldGroupObj extends TestCase } DPT.insertNewByName ("DataPilotTable", sCellAdress, DPDsc); - XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + XIndexAccess xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); XIndexAccess IA = null; try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); //getSRange(IA); System.out.println ("COUNT: "+IA.getCount ()); @@ -306,14 +306,14 @@ public class ScDataPilotFieldGroupObj extends TestCase try { - XDataPilotFieldGrouping dpfg = (XDataPilotFieldGrouping) UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); + XDataPilotFieldGrouping dpfg = UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); String[] elements = new String[]{"aName","otherName"}; dpfg.createNameGroup (elements); DataPilotFieldGroupInfo dpgi=null; - xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); } catch (com.sun.star.lang.WrappedTargetException e) @@ -334,13 +334,13 @@ public class ScDataPilotFieldGroupObj extends TestCase if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); - XNamed xNamed = (XNamed) UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); + XNamed xNamed = UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); System.out.println ("name: "+xNamed.getName ()); dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo"); } } groups = dpgi.Groups; - XIndexAccess groupAccess = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, groups); + XIndexAccess groupAccess = UnoRuntime.queryInterface(XIndexAccess.class, groups); oObj = (XInterface) 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 d7d4d255d7a5..7805d7d9ed70 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java @@ -86,7 +86,7 @@ public class ScDataPilotFieldGroupsObj extends TestCase { log.println (" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface ( + XComponent oComp = UnoRuntime.queryInterface ( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc (oComp); } @@ -121,7 +121,7 @@ public class ScDataPilotFieldGroupsObj extends TestCase XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface ( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -214,7 +214,7 @@ public class ScDataPilotFieldGroupsObj extends TestCase // create the test objects log.println ("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface ( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface ( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables (); @@ -277,11 +277,11 @@ public class ScDataPilotFieldGroupsObj extends TestCase } DPT.insertNewByName ("DataPilotTable", sCellAdress, DPDsc); - XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + XIndexAccess xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); XIndexAccess IA = null; try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); //getSRange(IA); System.out.println ("COUNT: "+IA.getCount ()); @@ -306,14 +306,14 @@ public class ScDataPilotFieldGroupsObj extends TestCase try { - XDataPilotFieldGrouping dpfg = (XDataPilotFieldGrouping) UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); + XDataPilotFieldGrouping dpfg = UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); String[] elements = new String[]{"aName","otherName"}; dpfg.createNameGroup (elements); DataPilotFieldGroupInfo dpgi=null; - xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); } catch (com.sun.star.lang.WrappedTargetException e) @@ -334,7 +334,7 @@ public class ScDataPilotFieldGroupsObj extends TestCase if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); - XNamed xNamed = (XNamed) UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); + 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 d1bef71fe6f7..0e07ddfb1e4f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java @@ -95,7 +95,7 @@ public class ScDataPilotFieldObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -143,7 +143,7 @@ public class ScDataPilotFieldObj extends TestCase { XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -212,7 +212,7 @@ public class ScDataPilotFieldObj extends TestCase { // create the test objects log.println("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables(); @@ -311,7 +311,7 @@ public class ScDataPilotFieldObj extends TestCase { return; } - XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class, + XNamed named = UnoRuntime.queryInterface(XNamed.class, field); String name = named.getName(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java index 8af51bbadcfe..dd91506fc6fe 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java @@ -81,8 +81,7 @@ public class ScDataPilotFieldsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -115,8 +114,7 @@ public class ScDataPilotFieldsObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -147,8 +145,7 @@ public class ScDataPilotFieldsObj extends TestCase { throw new StatusException("Couldn't fill some cells", e); } - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Getting test object ") ; diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java index fde5b26c1400..eec1c97364ff 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java @@ -96,7 +96,7 @@ public class ScDataPilotItemObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -144,7 +144,7 @@ public class ScDataPilotItemObj extends TestCase { XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -213,7 +213,7 @@ public class ScDataPilotItemObj extends TestCase { // create the test objects log.println("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables(); @@ -281,7 +281,7 @@ public class ScDataPilotItemObj extends TestCase { log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); - XDataPilotField xDataPilotField = (XDataPilotField) UnoRuntime.queryInterface( + XDataPilotField xDataPilotField = UnoRuntime.queryInterface( XDataPilotField.class, oObj); XIndexAccess xIA = xDataPilotField.getItems(); @@ -329,7 +329,7 @@ public class ScDataPilotItemObj extends TestCase { return; } - XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class, + XNamed named = UnoRuntime.queryInterface(XNamed.class, field); String name = named.getName(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java index 5cf917621745..60f40eefa7b8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java @@ -96,7 +96,7 @@ public class ScDataPilotItemsObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -144,7 +144,7 @@ public class ScDataPilotItemsObj extends TestCase { XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -213,7 +213,7 @@ public class ScDataPilotItemsObj extends TestCase { // create the test objects log.println("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables(); @@ -281,7 +281,7 @@ public class ScDataPilotItemsObj extends TestCase { log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); - XDataPilotField xDataPilotField = (XDataPilotField) UnoRuntime.queryInterface( + XDataPilotField xDataPilotField = UnoRuntime.queryInterface( XDataPilotField.class, oObj); oObj = xDataPilotField.getItems(); @@ -317,7 +317,7 @@ public class ScDataPilotItemsObj extends TestCase { return; } - XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class, + XNamed named = UnoRuntime.queryInterface(XNamed.class, field); String name = named.getName(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java index d0eb5774275e..e5301fe94080 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java @@ -87,8 +87,7 @@ public class ScDataPilotTableObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -137,8 +136,7 @@ public class ScDataPilotTableObj extends TestCase { log.println( "Creating a test environment" ); log.println("getting sheets"); XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); XSpreadsheet oSheet = null; Object oChangeCell = null; Object oCheckCell = null; @@ -196,8 +194,7 @@ public class ScDataPilotTableObj extends TestCase { filterFields[1].NumericValue = 12; filterFields[1].Operator = com.sun.star.sheet.FilterOperator.LESS_EQUAL; - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Getting test object"); XDataPilotTables DPT = DPTS.getDataPilotTables(); XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor(); @@ -283,8 +280,7 @@ public class ScDataPilotTableObj extends TestCase { */ private void createTable2(XSpreadsheet oSheet, CellRangeAddress srcRange, TestEnvironment tEnv) { - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Creating test table object"); XDataPilotTables DPT = DPTS.getDataPilotTables(); XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java index 597c96dcf3a4..a4afcd727729 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java @@ -84,8 +84,7 @@ public class ScDataPilotTablesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -122,8 +121,7 @@ public class ScDataPilotTablesObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -155,8 +153,7 @@ public class ScDataPilotTablesObj extends TestCase { throw new StatusException("Couldn't fill some cells", e); } - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Getting test object ") ; diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java index f852b4d4347f..80a614fb7e4e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java @@ -95,7 +95,7 @@ public class ScDatabaseRangeObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -140,7 +140,7 @@ public class ScDatabaseRangeObj extends TestCase { try { Object sheet = sheets.getByName(names[0]); - xImp = (XImportable) UnoRuntime.queryInterface(XImportable.class, + xImp = UnoRuntime.queryInterface(XImportable.class, sheet); dbRanges = (XDatabaseRanges) AnyConverter.toObject( new Type(XDatabaseRanges.class), @@ -180,14 +180,14 @@ public class ScDatabaseRangeObj extends TestCase { // we need to add it dbRanges.addNewByName(dbName,new CellRangeAddress((short)0, 0, 0, 0, 5)); - xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class, + xNamed = UnoRuntime.queryInterface(XNamed.class, dbrNA.getByName( dbName)); - XCellRangeReferrer aReferrer = (XCellRangeReferrer) UnoRuntime.queryInterface( + XCellRangeReferrer aReferrer = UnoRuntime.queryInterface( XCellRangeReferrer.class, dbrNA.getByName(dbName)); - XCellRangeAddressable aRangeA = (XCellRangeAddressable) UnoRuntime.queryInterface( + XCellRangeAddressable aRangeA = UnoRuntime.queryInterface( XCellRangeAddressable.class, aReferrer.getReferredCells()); aRange = aRangeA.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java index 792ce420ac40..915579e496f4 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java @@ -79,8 +79,7 @@ public class ScDatabaseRangesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java b/qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java index 9b735d2da460..e444bf25b771 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java +++ b/qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java @@ -61,7 +61,7 @@ public class ScDocumentConfiguration extends TestCase { protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - XMultiServiceFactory docMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( + XMultiServiceFactory docMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, xSheetDoc); Object oObj = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java index 5036a207fed0..ea4bf9c9b0ef 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java @@ -67,8 +67,7 @@ public class ScDrawPageObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent xComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xDoc); + XComponent xComp = UnoRuntime.queryInterface(XComponent.class, xDoc); util.DesktopTools.closeDoc(xComp); } @@ -97,16 +96,14 @@ public class ScDrawPageObj extends TestCase { XShape oShape = null ; XDrawPages oDP = null; - XComponent xComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xDoc); + XComponent xComp = UnoRuntime.queryInterface(XComponent.class, xDoc); // creation of testobject here // first we write what we are intend to do to log file log.println( "creating a test environment" ); try { log.println( "getting Drawpages" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDoc); oDP = (XDrawPages) oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); diff --git a/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java b/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java index cd8ad64a4da0..f2ae638a3fb8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java @@ -83,8 +83,7 @@ public class ScDrawPagesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -109,8 +108,7 @@ public class ScDrawPagesObj extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpages" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xSheetDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xSheetDoc); oDP = (XDrawPages) oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); diff --git a/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java index 22757d77d626..8b8daaab782b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java @@ -81,8 +81,7 @@ public class ScFilterDescriptorBase extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -106,8 +105,7 @@ public class ScFilterDescriptorBase extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -134,8 +132,7 @@ public class ScFilterDescriptorBase extends TestCase { "Exception occurred while filling cells", e); } - SF = (XSheetFilterable) - UnoRuntime.queryInterface(XSheetFilterable.class, oSheet); + SF = UnoRuntime.queryInterface(XSheetFilterable.class, oSheet); oObj = SF.createFilterDescriptor(true); diff --git a/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java b/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java index 5a4890544efe..85cfc2bad05e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java @@ -53,7 +53,7 @@ public class ScFunctionDescriptionObj extends TestCase { protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime. + XComponent oComp = UnoRuntime. queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java b/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java index 0dd27aaf7759..6aa95553f323 100644 --- a/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java @@ -77,8 +77,7 @@ public class ScFunctionListObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java index 38f8fbf3f356..af8b1d08cbca 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java @@ -90,8 +90,7 @@ public class ScHeaderFieldObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -130,10 +129,9 @@ public class ScHeaderFieldObj extends TestCase { XTextContent oContent = null; XInterface aField = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); try{ @@ -177,18 +175,16 @@ public class ScHeaderFieldObj extends TestCase { XText left = RPHC.getLeftText(); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface( - XMultiServiceFactory.class, - xSpreadsheetDoc ); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( + XMultiServiceFactory.class, + xSpreadsheetDoc ); XTextContent the_Field = null; try { oObj = (XInterface) oDocMSF.createInstance( "com.sun.star.text.TextField.Time" ); - the_Field = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,oObj); + the_Field = UnoRuntime.queryInterface(XTextContent.class,oObj); aField = (XInterface) oDocMSF.createInstance("com.sun.star.text.TextField.Date"); @@ -197,8 +193,7 @@ public class ScHeaderFieldObj extends TestCase { throw new StatusException("Couldn't create instance", e); } - oContent = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, aField); + oContent = UnoRuntime.queryInterface(XTextContent.class, aField); XTextCursor the_Cursor = left.createTextCursor(); diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java index b881e1d8eb93..b87925cdfabb 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java @@ -86,8 +86,7 @@ public class ScHeaderFieldsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -116,9 +115,8 @@ public class ScHeaderFieldsObj extends TestCase { XNameAccess PageStyles = null; XStyle StdStyle = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); try{ @@ -162,18 +160,16 @@ public class ScHeaderFieldsObj extends TestCase { XText left = RPHC.getLeftText(); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface( - XMultiServiceFactory.class, - xSpreadsheetDoc ); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( + XMultiServiceFactory.class, + xSpreadsheetDoc ); XTextContent the_Field = null; try { oObj = (XInterface) oDocMSF.createInstance( "com.sun.star.text.TextField.Time" ); - the_Field = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,oObj); + the_Field = UnoRuntime.queryInterface(XTextContent.class,oObj); } catch(com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -199,8 +195,7 @@ public class ScHeaderFieldsObj extends TestCase { throw new StatusException("Couldn't create a test environment", e); } - XTextFieldsSupplier xTFSupp = (XTextFieldsSupplier) - UnoRuntime.queryInterface(XTextFieldsSupplier.class, left); + XTextFieldsSupplier xTFSupp = UnoRuntime.queryInterface(XTextFieldsSupplier.class, left); oObj = xTFSupp.getTextFields(); diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java index 5b2746c216b7..bbadda64e346 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java @@ -76,8 +76,7 @@ public class ScHeaderFooterContentObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -102,10 +101,9 @@ public class ScHeaderFooterContentObj extends TestCase { XNameAccess PageStyles = null; XStyle StdStyle = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); try{ PageStyles = (XNameAccess) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java index 949c47a4e8bf..15be879ddf39 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java @@ -114,8 +114,7 @@ public class ScHeaderFooterTextCursor extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -140,10 +139,9 @@ public class ScHeaderFooterTextCursor extends TestCase { XNameAccess PageStyles = null; XStyle StdStyle = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); try{ diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java index 3bda23924de0..530f54120ed1 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java @@ -104,8 +104,7 @@ public class ScHeaderFooterTextObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -145,10 +144,9 @@ public class ScHeaderFooterTextObj extends TestCase { XNameAccess PageStyles = null; XStyle StdStyle = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); try{ PageStyles = (XNameAccess) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java index f68d90d31c4d..edd2911df097 100644 --- a/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java @@ -83,7 +83,7 @@ public class ScImportDescriptorBase extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -119,8 +119,7 @@ public class ScImportDescriptorBase extends TestCase { if (xSpreadsheets == null) log.println("FAILED"); else log.println("OK"); log.println("getting a sheet"); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); @@ -128,7 +127,7 @@ public class ScImportDescriptorBase extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - xIMP = (XImportable) UnoRuntime.queryInterface(XImportable.class,oObj); + xIMP = UnoRuntime.queryInterface(XImportable.class,oObj); TestEnvironment tEnv = new TestEnvironment(oObj); tEnv.addObjRelation("xIMP",xIMP); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java index c2c2362d017e..dbf755481643 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java @@ -66,8 +66,7 @@ public class ScIndexEnumeration_CellAnnotationsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -80,8 +79,7 @@ public class ScIndexEnumeration_CellAnnotationsEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -107,12 +105,10 @@ public class ScIndexEnumeration_CellAnnotationsEnumeration extends TestCase { "Exception occurred while filling cells", e); } - XSheetAnnotationsSupplier sas = (XSheetAnnotationsSupplier) - UnoRuntime.queryInterface(XSheetAnnotationsSupplier.class, oSheet); + XSheetAnnotationsSupplier sas = UnoRuntime.queryInterface(XSheetAnnotationsSupplier.class, oSheet); XSheetAnnotations anno = sas.getAnnotations(); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class, anno); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class, anno); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java index 482a840a0549..d63546f09d10 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java @@ -63,7 +63,7 @@ public class ScIndexEnumeration_CellAreaLinksEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -90,8 +90,7 @@ public class ScIndexEnumeration_CellAreaLinksEnumeration extends TestCase { String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc"); links.insertAtPosition (addr, aSourceArea, "a2:b5", "", "") ; - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java index 437820c29ef3..66cb82de4e63 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java @@ -66,7 +66,7 @@ public class ScIndexEnumeration_DDELinksEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime. + XComponent oComp = UnoRuntime. queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); util.DesktopTools.closeDoc(oDoc); @@ -104,8 +104,7 @@ public class ScIndexEnumeration_DDELinksEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -159,8 +158,7 @@ public class ScIndexEnumeration_DDELinksEnumeration extends TestCase { "Error getting test object from spreadsheet document", e) ; } - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java index c4f7b3c1ae28..734c735f0e61 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java @@ -68,8 +68,7 @@ public class ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -88,8 +87,7 @@ public class ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -120,8 +118,7 @@ public class ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase { throw new StatusException("Couldn't fill some cells", e); } - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Getting test object ") ; @@ -137,8 +134,7 @@ public class ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase { log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java index bdc815fffe3c..3c2e8d8c5707 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java @@ -98,7 +98,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -146,7 +146,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -215,7 +215,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration // create the test objects log.println("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables(); @@ -283,10 +283,10 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); - XDataPilotField xDataPilotField = (XDataPilotField) UnoRuntime.queryInterface( + XDataPilotField xDataPilotField = UnoRuntime.queryInterface( XDataPilotField.class, oObj); - XEnumerationAccess xEnumerationAccess = (XEnumerationAccess) UnoRuntime.queryInterface( + XEnumerationAccess xEnumerationAccess = UnoRuntime.queryInterface( XEnumerationAccess.class, xDataPilotField.getItems()); @@ -323,7 +323,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration return; } - XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class, + XNamed named = UnoRuntime.queryInterface(XNamed.class, field); String name = named.getName(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java index 8f1730e786e5..be0ae0c276ef 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java @@ -68,8 +68,7 @@ public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -88,8 +87,7 @@ public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -120,8 +118,7 @@ public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase { throw new StatusException("Couldn't fill some cells", e); } - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Getting test object ") ; @@ -138,8 +135,7 @@ public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase { log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java index bf530d9e805b..0f0b2854ae0b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java @@ -64,8 +64,7 @@ public class ScIndexEnumeration_DatabaseRangesEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -107,8 +106,7 @@ public class ScIndexEnumeration_DatabaseRangesEnumeration extends TestCase { } oObj = dbRanges; - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java index 7930165ad743..b877bd73d49f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java @@ -58,8 +58,7 @@ public class ScIndexEnumeration_FunctionDescriptionEnumeration extends TestCase */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -85,8 +84,7 @@ public class ScIndexEnumeration_FunctionDescriptionEnumeration extends TestCase "Error getting test object from spreadsheet document", e); } - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java index c5904986ac2f..207a7c427a19 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java @@ -61,8 +61,7 @@ public class ScIndexEnumeration_LabelRangesEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -79,8 +78,7 @@ public class ScIndexEnumeration_LabelRangesEnumeration extends TestCase { XPropertySet docProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); - XLabelRanges lRanges = (XLabelRanges) - UnoRuntime.queryInterface(XLabelRanges.class, ranges); + XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); log.println("Adding at least one element for ElementAccess interface"); CellRangeAddress aRange2 = new CellRangeAddress((short)0, 0, 1, 0, 6); @@ -99,8 +97,7 @@ public class ScIndexEnumeration_LabelRangesEnumeration extends TestCase { } log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java index 0aed1468b55f..1b3165192202 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java @@ -61,8 +61,7 @@ public class ScIndexEnumeration_NamedRangesEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -90,8 +89,7 @@ public class ScIndexEnumeration_NamedRangesEnumeration extends TestCase { throw new StatusException("Couldn't get NamedRanges", e); } - XNamedRanges xNamedRanges = (XNamedRanges) - UnoRuntime.queryInterface(XNamedRanges.class, ranges); + XNamedRanges xNamedRanges = UnoRuntime.queryInterface(XNamedRanges.class, ranges); CellRangeAddress DataArea = new CellRangeAddress((short)0, 0, 0, 2, 2); CellAddress base = new CellAddress(DataArea.Sheet, @@ -105,8 +103,7 @@ public class ScIndexEnumeration_NamedRangesEnumeration extends TestCase { oObj = xNamedRanges; - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java index ffc1fff7bbf2..a8bd4f0ab663 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java @@ -66,8 +66,7 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -77,8 +76,7 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -103,13 +101,11 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { throw new StatusException("Couldn't fill some cell", e); } - XScenariosSupplier xSupp = (XScenariosSupplier) - UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); + XScenariosSupplier xSupp = UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); XCellRange oRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); - XCellRangeAddressable oRangeAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); CellRangeAddress[] oAddr = new CellRangeAddress[1]; @@ -119,8 +115,7 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { XInterface oObj = xSupp.getScenarios(); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java index 49711118a32c..0cdbf4821317 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java @@ -66,7 +66,7 @@ public class ScIndexEnumeration_SheetCellRangesEnumeration extends TestCase { protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); XComponent oComp = - (XComponent) UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -84,15 +84,13 @@ public class ScIndexEnumeration_SheetCellRangesEnumeration extends TestCase { log.println("Getting test object "); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); oObj = (XInterface) SOF.createInstance(oComp, "com.sun.star.sheet.SheetCellRanges"); XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndSheets = (XIndexAccess) - UnoRuntime.queryInterface (XIndexAccess.class, oSheets); + XIndexAccess oIndSheets = UnoRuntime.queryInterface (XIndexAccess.class, oSheets); XSpreadsheet oSheet = null; try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -140,8 +138,7 @@ public class ScIndexEnumeration_SheetCellRangesEnumeration extends TestCase { "Exception occurred while filling cells", e); } - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java index 43d3fae76098..823825791feb 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java @@ -64,8 +64,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -80,8 +79,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { log.println("Getting test object ") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -96,8 +94,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - XSheetLinkable SL = (XSheetLinkable) - UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); + XSheetLinkable SL = UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); // creating link. String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc"); @@ -121,8 +118,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, links); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java index b1ba1d98b59b..162d677b69bc 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java @@ -64,18 +64,15 @@ public class ScIndexEnumeration_SpreadsheetViewPanesEnumeration extends TestCase */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println("disposing xSpreadsheetDocument"); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { - XModel xm = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel xm = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XController xc = xm.getCurrentController(); - XIndexAccess xIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xc); + XIndexAccess xIA = UnoRuntime.queryInterface(XIndexAccess.class, xc); try { oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),xIA.getByIndex(0)); @@ -90,8 +87,7 @@ public class ScIndexEnumeration_SpreadsheetViewPanesEnumeration extends TestCase throw new StatusException("Couldn't get by index", e); } - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,xIA); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,xIA); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java index d4826a37e901..ec6601197b1b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java @@ -58,8 +58,7 @@ public class ScIndexEnumeration_SpreadsheetsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println("disposing xSpreadsheetDocument"); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -72,8 +71,7 @@ public class ScIndexEnumeration_SpreadsheetsEnumeration extends TestCase { UnoRuntime.queryInterface(XInterface.class, xSpreadsheets); log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java index 40395fb74093..28e3faef0325 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java @@ -70,8 +70,7 @@ public class ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -82,8 +81,7 @@ public class ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -98,8 +96,7 @@ public class ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - XSubTotalCalculatable xSTC = (XSubTotalCalculatable) - UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); + XSubTotalCalculatable xSTC = UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); XSubTotalDescriptor xSTD = xSTC.createSubTotalDescriptor(true); @@ -110,13 +107,11 @@ public class ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase { columns[0] = column; xSTD.addNew(columns, 1); - XIndexAccess oDescIndex = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSTD); + XIndexAccess oDescIndex = UnoRuntime.queryInterface(XIndexAccess.class, xSTD); XInterface oObj = null; - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oDescIndex); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oDescIndex); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java index 961a3f297525..ae1fea9f4f14 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java @@ -58,7 +58,7 @@ public class ScIndexEnumeration_TableAutoFormatEnumeration extends TestCase{ */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -73,8 +73,7 @@ public class ScIndexEnumeration_TableAutoFormatEnumeration extends TestCase{ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance ("com.sun.star.sheet.TableAutoFormats"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java index a6f8842cc0a4..dad41188204c 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java @@ -70,8 +70,7 @@ public class ScIndexEnumeration_TableChartsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -82,8 +81,7 @@ public class ScIndexEnumeration_TableChartsEnumeration extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); } catch (com.sun.star.lang.WrappedTargetException e) { @@ -169,14 +167,12 @@ public class ScIndexEnumeration_TableChartsEnumeration extends TestCase { XCellRange oRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); - XCellRangeAddressable oRangeAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); CellRangeAddress[] oAddr = new CellRangeAddress[1]; oAddr[0] = myAddr; - XTableChartsSupplier oSupp = (XTableChartsSupplier) - UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); + XTableChartsSupplier oSupp = UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); log.println("Insert Chart"); @@ -184,8 +180,7 @@ public class ScIndexEnumeration_TableChartsEnumeration extends TestCase { oCharts.addNewByName("ScChartObj", oRect, oAddr, true, true); log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oCharts); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oCharts); XInterface oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java index ea86a5b2e1e1..a907f195f65b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java @@ -65,8 +65,7 @@ public class ScIndexEnumeration_TableColumnsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -98,14 +97,12 @@ public class ScIndexEnumeration_TableColumnsEnumeration extends TestCase { throw new StatusException("Couldn't get spreadsheet", e); } - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); oObj = oColumns; log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java index 1a4a6ae21322..c457d7ef77eb 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java @@ -69,8 +69,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -82,8 +81,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -128,8 +126,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas } try { - XSheetConditionalEntries xSCE = (XSheetConditionalEntries) - UnoRuntime.queryInterface(XSheetConditionalEntries.class, CFormat); + XSheetConditionalEntries xSCE = UnoRuntime.queryInterface(XSheetConditionalEntries.class, CFormat); xSCE.addNew(Conditions()); Props.setPropertyValue("ConditionalFormat", xSCE); oObj = xSCE; @@ -152,8 +149,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas } log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java index 7c3954621f3f..2c12cd2dc40c 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java @@ -64,8 +64,7 @@ public class ScIndexEnumeration_TableRowsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -94,16 +93,14 @@ public class ScIndexEnumeration_TableRowsEnumeration extends TestCase { throw new StatusException("Couldn't get spreadsheet", e); } - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); oObj = oRows; log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java index a998d054aeed..e4b3947f61f2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java @@ -78,8 +78,7 @@ public class ScIndexEnumeration_TextFieldEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -104,28 +103,24 @@ public class ScIndexEnumeration_TextFieldEnumeration extends TestCase { // we want to create an instance of ScCellFieldObj. // to do this we must get an MultiServiceFactory. - XMultiServiceFactory _oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); + XMultiServiceFactory _oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); aField = (XInterface) _oMSF.createInstance("com.sun.star.text.TextField.URL"); - oContent = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, aField); + oContent = UnoRuntime.queryInterface(XTextContent.class, aField); XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); XCell oCell = oSheet.getCellByPosition(2,3); - oText = (XText)UnoRuntime.queryInterface(XText.class, oCell); + oText = UnoRuntime.queryInterface(XText.class, oCell); oText.insertTextContent( oText.createTextCursor(), oContent, true); - xTextFieldsSupp = (XTextFieldsSupplier) - UnoRuntime.queryInterface(XTextFieldsSupplier.class, oCell); + xTextFieldsSupp = UnoRuntime.queryInterface(XTextFieldsSupplier.class, oCell); oObj = xTextFieldsSupp.getTextFields().createEnumeration(); } catch (com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java index 70d0cf16fbe6..babd30b14efe 100644 --- a/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java @@ -74,8 +74,7 @@ public class ScLabelRangeObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -104,8 +103,7 @@ public class ScLabelRangeObj extends TestCase { XPropertySet docProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); - XLabelRanges lRanges = (XLabelRanges) - UnoRuntime.queryInterface(XLabelRanges.class, ranges); + XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); log.println("Adding at least one element for ElementAccess interface"); CellRangeAddress aRange2 = new CellRangeAddress((short)0, 0, 1, 0, 6); diff --git a/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java index e8e868c697b9..d9db0e49d36d 100644 --- a/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java @@ -77,8 +77,7 @@ public class ScLabelRangesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -107,8 +106,7 @@ public class ScLabelRangesObj extends TestCase { XPropertySet docProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); - XLabelRanges lRanges = (XLabelRanges) - UnoRuntime.queryInterface(XLabelRanges.class, ranges); + XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); log.println("Adding at least one element for ElementAccess interface"); CellRangeAddress aRange2 = new CellRangeAddress((short)0, 0, 1, 0, 6); diff --git a/qadevOOo/tests/java/mod/_sc/ScModelObj.java b/qadevOOo/tests/java/mod/_sc/ScModelObj.java index fa49117bcf3e..25925e0b6854 100644 --- a/qadevOOo/tests/java/mod/_sc/ScModelObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScModelObj.java @@ -84,11 +84,11 @@ public class ScModelObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); - oComp = (XComponent) UnoRuntime.queryInterface(XComponent.class, + oComp = UnoRuntime.queryInterface(XComponent.class, xSecondsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -126,13 +126,13 @@ public class ScModelObj extends TestCase { (XMultiServiceFactory) Param.getMSF()); if (xSpreadsheetDoc != null) { - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } if (xSecondsheetDoc != null) { - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSecondsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -146,9 +146,9 @@ public class ScModelObj extends TestCase { throw new StatusException("Couldn't create document ", e); } - XModel model1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel model1 = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); - XModel model2 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel model2 = UnoRuntime.queryInterface(XModel.class, xSecondsheetDoc); XInterface oObj = model1; @@ -159,7 +159,7 @@ public class ScModelObj extends TestCase { cont1.getFrame().setName("cont1"); cont2.getFrame().setName("cont2"); - XSelectionSupplier sel = (XSelectionSupplier) UnoRuntime.queryInterface( + XSelectionSupplier sel = UnoRuntime.queryInterface( XSelectionSupplier.class, cont1); XCell toSel = null; @@ -168,7 +168,7 @@ public class ScModelObj extends TestCase { log.println("Getting spreadsheet"); XSpreadsheets oSheets = xSpreadsheetDoc.getSheets(); - XIndexAccess oIndexSheets = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexSheets = UnoRuntime.queryInterface( XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), diff --git a/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java index 687ee4919192..a4dd4a158b7f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java @@ -80,8 +80,7 @@ public class ScNamedRangeObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -124,8 +123,7 @@ public class ScNamedRangeObj extends TestCase { throw new StatusException("Couldn't get NamedRanges", e); } - XNamedRanges xNamedRanges = (XNamedRanges) - UnoRuntime.queryInterface(XNamedRanges.class, ranges); + XNamedRanges xNamedRanges = UnoRuntime.queryInterface(XNamedRanges.class, ranges); CellRangeAddress DataArea = new CellRangeAddress((short)0, 0, 0, 1, 1); CellAddress base = new CellAddress(DataArea.Sheet, diff --git a/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java index 64e472fb1757..20e24abd113a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java @@ -82,8 +82,7 @@ public class ScNamedRangesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -113,8 +112,7 @@ public class ScNamedRangesObj extends TestCase { log.println("Getting test object "); XSpreadsheets oSheets = xSheetDoc.getSheets(); - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -143,8 +141,7 @@ public class ScNamedRangesObj extends TestCase { throw new StatusException("Couldn't get NamedRanges", e); } - XNamedRanges xNamedRanges = (XNamedRanges) - UnoRuntime.queryInterface(XNamedRanges.class, ranges); + XNamedRanges xNamedRanges = UnoRuntime.queryInterface(XNamedRanges.class, ranges); CellRangeAddress DataArea = new CellRangeAddress((short)0, 0, 0, 2, 2); CellAddress base = new CellAddress(DataArea.Sheet, diff --git a/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java b/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java index ac06c2f76bfc..4e89e744c1dc 100644 --- a/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java @@ -68,8 +68,7 @@ public class ScRecentFunctionsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java b/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java index 2b1789acf0b5..6d8668237226 100644 --- a/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java @@ -82,8 +82,7 @@ public class ScScenariosObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -110,8 +109,7 @@ public class ScScenariosObj extends TestCase { XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet)AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -136,13 +134,11 @@ public class ScScenariosObj extends TestCase { throw new StatusException("Couldn't fill some cell", e); } - XScenariosSupplier xSupp = (XScenariosSupplier) - UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); + XScenariosSupplier xSupp = UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); XCellRange oRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); - XCellRangeAddressable oRangeAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); CellRangeAddress[] oAddr = new CellRangeAddress[1]; diff --git a/qadevOOo/tests/java/mod/_sc/ScShapeObj.java b/qadevOOo/tests/java/mod/_sc/ScShapeObj.java index a6f95df61e1e..8533557383df 100644 --- a/qadevOOo/tests/java/mod/_sc/ScShapeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScShapeObj.java @@ -43,7 +43,7 @@ public class ScShapeObj extends TestCase { try { log.println( "creating a sheetdoc" ); - xSheetDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc(null)); + xSheetDoc = UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc(null)); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java index 3b2cabd674af..9658c523cc7c 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java @@ -89,8 +89,7 @@ public class ScSheetLinkObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -116,8 +115,7 @@ public class ScSheetLinkObj extends TestCase { log.println("Getting test object ") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -132,8 +130,7 @@ public class ScSheetLinkObj extends TestCase { throw new StatusException("Couldn't get a spreadsheet", e); } - XSheetLinkable SL = (XSheetLinkable) - UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); + XSheetLinkable SL = UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); // creating link. Doesn't matter that it refers to unexistant object. // this is for proper work of XAccess tests. diff --git a/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java b/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java index b76ed04a5779..6ff3902346f1 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java @@ -77,8 +77,7 @@ public class ScSheetLinksObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -104,8 +103,7 @@ public class ScSheetLinksObj extends TestCase { log.println("Getting test object ") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -120,8 +118,7 @@ public class ScSheetLinksObj extends TestCase { throw new StatusException("Couldn't get a spreadsheet", e); } - XSheetLinkable SL = (XSheetLinkable) - UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); + XSheetLinkable SL = UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); // creating link. Doesn't matter that it refers to unexistant object. // this is for proper work of X*Access tests. diff --git a/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java index e264c3c4379a..936bb8c5ffd9 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java @@ -85,7 +85,7 @@ public class ScSortDescriptorBase extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -121,8 +121,7 @@ public class ScSortDescriptorBase extends TestCase { if (xSpreadsheets == null) log.println("FAILED"); else log.println("OK"); log.println("getting a sheet"); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); @@ -130,7 +129,7 @@ public class ScSortDescriptorBase extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - xSORT = (XSortable) UnoRuntime.queryInterface(XSortable.class,oObj); + xSORT = UnoRuntime.queryInterface(XSortable.class,oObj); TestEnvironment tEnv = new TestEnvironment(oObj); tEnv.addObjRelation("xSORT",xSORT); diff --git a/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java index 58c003304a17..495f46a423f6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java @@ -70,8 +70,7 @@ public class ScSpreadsheetSettingsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java index 1d1fdd35c134..28ae5ef1df05 100644 --- a/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java @@ -74,8 +74,7 @@ public class ScStyleFamiliesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -98,9 +97,8 @@ public class ScStyleFamiliesObj extends TestCase { XNameAccess oStyleFamilies=null; // create testobject here log.println("getting style families"); - XStyleFamiliesSupplier oStyleFamiliesSupplier =(XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, xSpreadsheetDoc); + XStyleFamiliesSupplier oStyleFamiliesSupplier =UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, xSpreadsheetDoc); oStyleFamilies = oStyleFamiliesSupplier.getStyleFamilies(); diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java index 6d40cd56f107..410535d129db 100644 --- a/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java @@ -85,8 +85,7 @@ public class ScStyleFamilyObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -122,13 +121,11 @@ public class ScStyleFamilyObj extends TestCase { XNameAccess oStyleFamilyNameAccess = null; // create testobject here log.println("getting style"); - XStyleFamiliesSupplier oStyleFamiliesSupplier = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, xSpreadsheetDoc); + XStyleFamiliesSupplier oStyleFamiliesSupplier = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, xSpreadsheetDoc); XNameAccess oStyleFamilies = oStyleFamiliesSupplier.getStyleFamilies(); - XIndexAccess oStyleFamiliesIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oStyleFamilies); + XIndexAccess oStyleFamiliesIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oStyleFamilies); try { oStyleFamilyNameAccess = (XNameAccess) AnyConverter.toObject( new Type(XNameAccess.class), @@ -148,8 +145,7 @@ public class ScStyleFamilyObj extends TestCase { } SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF()); - XComponent xComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent xComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); XInterface oInstance = (XInterface) SOF.createInstance(xComp,"com.sun.star.style.CellStyle"); diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleObj.java index 2b929a966925..e5d782628a06 100644 --- a/qadevOOo/tests/java/mod/_sc/ScStyleObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScStyleObj.java @@ -87,8 +87,7 @@ public class ScStyleObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -123,12 +122,10 @@ public class ScStyleObj extends TestCase { log.println("creating a test environment"); log.println("getting style"); - XStyleFamiliesSupplier oStyleFamiliesSupplier = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, xSpreadsheetDoc); + XStyleFamiliesSupplier oStyleFamiliesSupplier = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, xSpreadsheetDoc); XNameAccess oStyleFamilies = oStyleFamiliesSupplier.getStyleFamilies(); - XIndexAccess oStyleFamiliesIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oStyleFamilies); + XIndexAccess oStyleFamiliesIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oStyleFamilies); XNameAccess oStyleFamilyNameAccess = null; XStyle oStyle = null; try { @@ -136,9 +133,8 @@ public class ScStyleObj extends TestCase { new Type(XNameAccess.class), oStyleFamiliesIndexAccess.getByIndex(0)); - XIndexAccess oStyleFamilyIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, - oStyleFamilyNameAccess); + XIndexAccess oStyleFamilyIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, + oStyleFamilyNameAccess); oStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oStyleFamilyIndexAccess.getByIndex(0)); } catch(com.sun.star.lang.WrappedTargetException e) { @@ -153,9 +149,8 @@ public class ScStyleObj extends TestCase { } log.println("Creating a user-defined style"); - XMultiServiceFactory oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface( - XMultiServiceFactory.class, xSpreadsheetDoc); + XMultiServiceFactory oMSF = UnoRuntime.queryInterface( + XMultiServiceFactory.class, xSpreadsheetDoc); XInterface oInt = null; try { @@ -194,8 +189,7 @@ public class ScStyleObj extends TestCase { //using the style log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCell aCell = null; try { @@ -247,7 +241,7 @@ public class ScStyleObj extends TestCase { public String[] getPropertyNames(XPropertySet props) { Property[] the_props = props.getPropertySetInfo().getProperties(); - ArrayList names = new ArrayList() ; + ArrayList<String> names = new ArrayList<String>() ; for (int i=0;i<the_props.length;i++) { boolean isWritable = @@ -256,6 +250,6 @@ public class ScStyleObj extends TestCase { names.add(the_props[i].Name); } } - return (String[]) names.toArray(new String[names.size()]) ; + return names.toArray(new String[names.size()]) ; } } // finish class ScStyleObj diff --git a/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java index e90dfd29782d..091d68ad3d80 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java @@ -86,8 +86,7 @@ public class ScSubTotalDescriptorBase extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -107,8 +106,7 @@ public class ScSubTotalDescriptorBase extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -123,8 +121,7 @@ public class ScSubTotalDescriptorBase extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - XSubTotalCalculatable xSTC = (XSubTotalCalculatable) - UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); + XSubTotalCalculatable xSTC = UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); SubTotalColumn[] columns = new SubTotalColumn[1]; SubTotalColumn column = new SubTotalColumn(); diff --git a/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java index efbddd2c7b2a..1f5416ab8d99 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java @@ -81,8 +81,7 @@ public class ScSubTotalFieldObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -104,8 +103,7 @@ public class ScSubTotalFieldObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type (XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -120,8 +118,7 @@ public class ScSubTotalFieldObj extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - XSubTotalCalculatable xSTC = (XSubTotalCalculatable) - UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); + XSubTotalCalculatable xSTC = UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); XSubTotalDescriptor xSTD = xSTC.createSubTotalDescriptor(true); @@ -132,8 +129,7 @@ public class ScSubTotalFieldObj extends TestCase { columns[0] = column; xSTD.addNew(columns, 1); - XIndexAccess oDescIndex = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSTD); + XIndexAccess oDescIndex = UnoRuntime.queryInterface(XIndexAccess.class, xSTD); XInterface oObj = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java index 97cd11129307..f7fd3415bff5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java @@ -113,11 +113,9 @@ public class ScTabViewObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); - XComponent oComp2 = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc2) ; + XComponent oComp2 = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc2) ; util.DesktopTools.closeDoc(oComp2); } @@ -139,11 +137,9 @@ public class ScTabViewObj extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { XDrawPage oDrawPage = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); - XModel aSecondModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc2); + XModel aSecondModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc2); XInterface oObj = aModel.getCurrentController(); @@ -152,8 +148,7 @@ public class ScTabViewObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), oIndexAccess.getByIndex(1)); @@ -201,10 +196,8 @@ public class ScTabViewObj extends TestCase { tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XCellRangeAddressable adr1 = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, o1); - XCellRangeAddressable adr2 = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, o2); + XCellRangeAddressable adr1 = UnoRuntime.queryInterface(XCellRangeAddressable.class, o1); + XCellRangeAddressable adr2 = UnoRuntime.queryInterface(XCellRangeAddressable.class, o2); if (adr1 == null || adr2 == null) return -1; CellRangeAddress range1 = adr1.getRangeAddress(); CellRangeAddress range2 = adr2.getRangeAddress(); @@ -223,7 +216,7 @@ public class ScTabViewObj extends TestCase { XShape aShape = null; try{ log.println("adding contol shape '" + kindOfControl + "'"); - XComponent oComp = (XComponent) UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; aShape = FormTools.createControlShape(oComp, 3000, 4500, 15000, 10000, kindOfControl); @@ -236,8 +229,7 @@ public class ScTabViewObj extends TestCase { log.println("adding relation for com.sun.star.view.XFormLayerAccess: XForm"); try { log.println( "getting Drawpages" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); XDrawPages oDP = (XDrawPages) oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java b/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java index d8837d19c676..fd674b3da5ab 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java @@ -84,8 +84,7 @@ public class ScTableColumnObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -133,11 +132,9 @@ public class ScTableColumnObj extends TestCase { throw new StatusException("Couldn't get element by name", e); } - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oColumns); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oColumns); try { oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),oIndexAccess.getByIndex(10)); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java index b8f33f913604..bdaa454deff5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java @@ -85,8 +85,7 @@ public class ScTableColumnsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -127,8 +126,7 @@ public class ScTableColumnsObj extends TestCase { throw new StatusException("Couldn't get spreadsheet", e); } - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); oObj = oColumns; diff --git a/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java index 55b21b7e028a..5ee191eba153 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java @@ -83,8 +83,7 @@ public class ScTableConditionalEntry extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -109,8 +108,7 @@ public class ScTableConditionalEntry extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -155,8 +153,7 @@ public class ScTableConditionalEntry extends TestCase { } try { - XSheetConditionalEntries xSCE = (XSheetConditionalEntries) - UnoRuntime.queryInterface(XSheetConditionalEntries.class, CFormat); + XSheetConditionalEntries xSCE = UnoRuntime.queryInterface(XSheetConditionalEntries.class, CFormat); xSCE.addNew(Conditions()); Props.setPropertyValue("ConditionalFormat", xSCE); oObj = (XSheetConditionalEntry) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java b/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java index b1f41c89f642..47b893ad0814 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java @@ -88,8 +88,7 @@ public class ScTableConditionalFormat extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -113,8 +112,7 @@ public class ScTableConditionalFormat extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -156,8 +154,7 @@ public class ScTableConditionalFormat extends TestCase { throw new StatusException("Couldn't get ConditionalFromat", e); } - XSheetConditionalEntries xSCE = (XSheetConditionalEntries) - UnoRuntime.queryInterface(XSheetConditionalEntries.class, oObj); + XSheetConditionalEntries xSCE = UnoRuntime.queryInterface(XSheetConditionalEntries.class, oObj); xSCE.addNew(Conditions(5)); xSCE.addNew(Conditions(2)); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java b/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java index 983ce908597e..91609c52a7f4 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java @@ -81,8 +81,7 @@ public class ScTableRowObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -118,11 +117,9 @@ public class ScTableRowObj extends TestCase { new Type(XSpreadsheet.class), oNames.getByName(oNames.getElementNames()[0])); - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oRows); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oRows); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),oIndexAccess.getByIndex(6)); } catch(com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java index 2e01c06c5999..4e4f9276b063 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java @@ -81,8 +81,7 @@ public class ScTableRowsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -120,8 +119,7 @@ public class ScTableRowsObj extends TestCase { throw new StatusException("Couldn't get spreadsheet", e); } - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); oObj = oRows; diff --git a/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java index 6b4080dc651c..2b053a5c3e8c 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java @@ -148,7 +148,7 @@ public class ScTableSheetObj extends TestCase { log.println(" disposing xSheetDoc "); try { - XCloseable oCloser = (XCloseable) UnoRuntime.queryInterface( + XCloseable oCloser = UnoRuntime.queryInterface( XCloseable.class, xSheetDoc); oCloser.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -192,7 +192,7 @@ public class ScTableSheetObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); try { @@ -250,7 +250,7 @@ public class ScTableSheetObj extends TestCase { tEnv.addObjRelation("XSheetLinkable.LinkSheet", "ScSheetLinksObj.ods"); //adding Scenario and with that a ScenarioSheet-Relation for Scenario and XScenarioEnhanced - XScenariosSupplier scene = (XScenariosSupplier) UnoRuntime.queryInterface( + XScenariosSupplier scene = UnoRuntime.queryInterface( XScenariosSupplier.class, tEnv.getTestObject()); scene.getScenarios() diff --git a/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java index d03bc08d756b..fd2e151c0a73 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java @@ -84,8 +84,7 @@ public class ScTableSheetsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println("disposing xSpreadsheetDocument"); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java b/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java index 3dd98ebaae01..8c0c1d6ca6ce 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java @@ -79,8 +79,7 @@ public class ScTableValidationObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -101,8 +100,7 @@ public class ScTableValidationObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java index 4a353a17ace6..f2a37f9fb723 100644 --- a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java @@ -73,7 +73,7 @@ public class ScUniqueCellFormatsEnumeration extends TestCase { PrintWriter log) { log.println("Getting the first sheet"); - XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess xIA = UnoRuntime.queryInterface( XIndexAccess.class, xSheetDoc.getSheets()); try { @@ -95,11 +95,11 @@ public class ScUniqueCellFormatsEnumeration extends TestCase { changeColor("C1:C10", 0, 0, 255); changeColor("D1:D10", 0, 255, 0); - XUniqueCellFormatRangesSupplier xUCRS = (XUniqueCellFormatRangesSupplier) UnoRuntime.queryInterface( + XUniqueCellFormatRangesSupplier xUCRS = UnoRuntime.queryInterface( XUniqueCellFormatRangesSupplier.class, oSheet); - XEnumerationAccess xEnum = (XEnumerationAccess) UnoRuntime.queryInterface( + XEnumerationAccess xEnum = UnoRuntime.queryInterface( XEnumerationAccess.class, xUCRS.getUniqueCellFormatRanges()); XInterface oObj = xEnum.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java index 7c83e6a87968..9d7b706668e9 100644 --- a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java @@ -72,7 +72,7 @@ public class ScUniqueCellFormatsObj extends TestCase { PrintWriter log) { log.println("Getting the first sheet"); - XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess xIA = UnoRuntime.queryInterface( XIndexAccess.class, xSheetDoc.getSheets()); try { @@ -94,7 +94,7 @@ public class ScUniqueCellFormatsObj extends TestCase { changeColor("C1:C10", 0, 0, 255); changeColor("D1:D10", 0, 255, 0); - XUniqueCellFormatRangesSupplier xUCRS = (XUniqueCellFormatRangesSupplier) UnoRuntime.queryInterface( + XUniqueCellFormatRangesSupplier xUCRS = UnoRuntime.queryInterface( XUniqueCellFormatRangesSupplier.class, oSheet); diff --git a/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java index 8982389de7ec..bdda48d7ad76 100644 --- a/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java @@ -88,8 +88,7 @@ public class ScViewPaneObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println("disposing xSpreadsheetDocument"); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -111,11 +110,9 @@ public class ScViewPaneObj extends TestCase { protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { XDrawPage oDrawPage; - XModel xm = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel xm = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XController xc = xm.getCurrentController(); - XIndexAccess xIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xc); + XIndexAccess xIA = UnoRuntime.queryInterface(XIndexAccess.class, xc); try { oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),xIA.getByIndex(0)); @@ -136,8 +133,7 @@ public class ScViewPaneObj extends TestCase { tEnv.addObjRelation("DOCUMENT", UnoRuntime.queryInterface(XComponent.class,xSpreadsheetDoc)); tEnv.addObjRelation("XControlAccess.isSheet", Boolean.TRUE); - XViewPane VP = (XViewPane) - UnoRuntime.queryInterface(XViewPane.class, oObj); + XViewPane VP = UnoRuntime.queryInterface(XViewPane.class, oObj); CellRangeAddress dataArea = VP.getVisibleRange(); tEnv.addObjRelation("DATAAREA", dataArea); @@ -149,7 +145,7 @@ public class ScViewPaneObj extends TestCase { XShape aShape = null; try{ log.println("adding contol shape '" + kindOfControl + "'"); - XComponent oComp = (XComponent) UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; aShape = FormTools.createControlShape(oComp, 3000, 4500, 15000, 10000, kindOfControl); @@ -161,8 +157,7 @@ public class ScViewPaneObj extends TestCase { try { log.println( "getting Drawpages" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); XDrawPages oDP = (XDrawPages) oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); diff --git a/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java b/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java index 9c95abfd3a12..d0781266a3f3 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java @@ -124,16 +124,14 @@ public class XMLContentExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Calc.XMLContentExporter", new Object[] {arg} ); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xSheetDoc); // Setting some string to a cell - XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xSpreadsheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); - XIndexAccess xSheetsIndexArray = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess xSheetsIndexArray = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); XSpreadsheet xSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(0)); XCell xCell = xSheet.getCellByPosition(0, 0); diff --git a/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java b/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java index 175692bdeba4..ce2456205772 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java @@ -73,7 +73,7 @@ public class XMLContentImporter extends TestCase { try { log.println( "creating a Spreadsheet document" ); xSheetDoc = SOF.createCalcDoc( null ); - comp = (XComponent) UnoRuntime.queryInterface + comp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -126,7 +126,7 @@ public class XMLContentImporter extends TestCase { try { oInt = xMSF.createInstance ("com.sun.star.comp.Calc.XMLContentImporter") ; - XImporter imp = (XImporter) UnoRuntime.queryInterface + XImporter imp = UnoRuntime.queryInterface (XImporter.class, oInt) ; imp.setTargetDocument(comp); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_sc/XMLExporter.java b/qadevOOo/tests/java/mod/_sc/XMLExporter.java index 5b8ec92f1f5b..3bf56304bb5e 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLExporter.java @@ -121,20 +121,17 @@ public class XMLExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Calc.XMLExporter", new Object[] {arg} ); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xSheetDoc); //set name of sheet - XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xSpreadsheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); - XIndexAccess xSheetsIndexArray = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess xSheetsIndexArray = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); XSpreadsheet xSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(0)); - XNamed xSheetNamed = (XNamed) - UnoRuntime.queryInterface(XNamed.class, xSheet); + XNamed xSheetNamed = UnoRuntime.queryInterface(XNamed.class, xSheet); xSheetNamed.setName(SHEET_NAME); log.println("fill sheet with contnet..."); diff --git a/qadevOOo/tests/java/mod/_sc/XMLImporter.java b/qadevOOo/tests/java/mod/_sc/XMLImporter.java index 63f112d1c889..9071cdde78e8 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLImporter.java @@ -72,7 +72,7 @@ public class XMLImporter extends TestCase { try { log.println( "creating a Spreadsheet document" ); XSpreadsheetDocument xSpreadsheetDoc = SOF.createCalcDoc( null ); - xSheetDoc = (XComponent) UnoRuntime.queryInterface + xSheetDoc = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -124,7 +124,7 @@ public class XMLImporter extends TestCase { try { oInt = xMSF.createInstance("com.sun.star.comp.Calc.XMLImporter") ; - XImporter imp = (XImporter) UnoRuntime.queryInterface + XImporter imp = UnoRuntime.queryInterface (XImporter.class, oInt) ; imp.setTargetDocument(xSheetDoc); } catch (com.sun.star.uno.Exception e) { @@ -159,8 +159,7 @@ public class XMLImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; final PrintWriter fLog = log ; - XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xSpreadsheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); final XSpreadsheets sheets = xSpreadsheetDoc.getSheets() ; log.println("Sheets before importing :") ; String[] names = sheets.getElementNames() ; diff --git a/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java index f265662ebf8e..7793b5d07673 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java @@ -128,14 +128,13 @@ public class XMLMetaExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Calc.XMLMetaExporter", new Object[] {arg}); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xSheetDoc); // Obtaining and changing property values - XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) - UnoRuntime.queryInterface (XDocumentInfoSupplier.class, - xSheetDoc) ; + XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, + xSheetDoc) ; XPropertySet docInfo = (XPropertySet) 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 e2358a4788e5..30875b90af74 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java @@ -74,7 +74,7 @@ public class XMLMetaImporter extends TestCase { try { log.println( "creating a Spreadsheet document" ); xSheetDoc = SOF.createCalcDoc( null ); - comp = (XComponent) UnoRuntime.queryInterface + comp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -128,7 +128,7 @@ public class XMLMetaImporter extends TestCase { try { oInt = xMSF.createInstance ("com.sun.star.comp.Calc.XMLMetaImporter") ; - XImporter imp = (XImporter) UnoRuntime.queryInterface + XImporter imp = UnoRuntime.queryInterface (XImporter.class, oInt) ; imp.setTargetDocument(comp) ; } catch (com.sun.star.uno.Exception e) { @@ -160,8 +160,7 @@ public class XMLMetaImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; - XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) - UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xSheetDoc) ; + XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xSheetDoc) ; final XPropertySet docInfo = (XPropertySet) 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 86917b4d7274..a8fba99670ec 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java @@ -121,13 +121,12 @@ public class XMLSettingsExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Calc.XMLSettingsExporter", new Object[] {arg} ); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xSheetDoc); //set some settings - XModel xSheetModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xSheetModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xSheetModel.getCurrentController(); XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xController); diff --git a/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java index fbc98c77d6a3..72218cfb741e 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java @@ -75,7 +75,7 @@ public class XMLSettingsImporter extends TestCase { try { log.println( "creating a Spreadsheet document" ); xSheetDoc = SOF.createCalcDoc( null ); - comp = (XComponent) UnoRuntime.queryInterface + comp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -129,12 +129,11 @@ public class XMLSettingsImporter extends TestCase { try { oInt = xMSF.createInstance ("com.sun.star.comp.Calc.XMLSettingsImporter") ; - XImporter imp = (XImporter) UnoRuntime.queryInterface + XImporter imp = UnoRuntime.queryInterface (XImporter.class, oInt) ; imp.setTargetDocument(comp) ; - XModel xSheetModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xSheetModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xSheetModel.getCurrentController(); xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xController); diff --git a/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java index 0382235a6ae5..ff310e27d168 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java @@ -128,14 +128,12 @@ public class XMLStylesExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Calc.XMLStylesExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xSheetDoc); // Obtaining and changing property values - XStyleFamiliesSupplier styleSup = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, xSheetDoc); + XStyleFamiliesSupplier styleSup = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, xSheetDoc); XNameAccess StyleFamilies = styleSup.getStyleFamilies(); String[] styleFamiliesNames = StyleFamilies.getElementNames(); XNameContainer StyleFamilyName = (XNameContainer) diff --git a/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java index b8810295e235..a83e770ac51b 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java @@ -74,7 +74,7 @@ public class XMLStylesImporter extends TestCase { try { log.println( "creating a Spreadsheet document" ); xSheetDoc = SOF.createCalcDoc( null ); - comp = (XComponent) UnoRuntime.queryInterface + comp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -127,7 +127,7 @@ public class XMLStylesImporter extends TestCase { try { oInt = xMSF.createInstance ("com.sun.star.comp.Calc.XMLStylesImporter") ; - XImporter imp = (XImporter) UnoRuntime.queryInterface + XImporter imp = UnoRuntime.queryInterface (XImporter.class, oInt) ; imp.setTargetDocument(comp) ; } catch (com.sun.star.uno.Exception e) { @@ -170,9 +170,8 @@ public class XMLStylesImporter extends TestCase { XNameAccess styles = null ; try { - XStyleFamiliesSupplier sup = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface - (XStyleFamiliesSupplier.class, xSheetDoc); + XStyleFamiliesSupplier sup = UnoRuntime.queryInterface + (XStyleFamiliesSupplier.class, xSheetDoc); XNameAccess oStyleFamilies = sup.getStyleFamilies(); Object family = oStyleFamilies.getByName("CellStyles") ; styles = (XNameAccess) UnoRuntime.queryInterface |