diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-27 15:40:17 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-29 22:03:01 +0200 |
commit | b65017a2a7af290f6681da7b197a52efe83d5185 (patch) | |
tree | 06f71a435ba200d044109469b13be7c8f5dbe950 /qadevOOo/tests/java/mod/_forms | |
parent | 33ec740d1438c3dddf8e1974757ed05bb76425ca (diff) |
Java5 update - usage generics where possible
Change-Id: I12f8c448961919e153047e28fee2a0acf3af1002
Diffstat (limited to 'qadevOOo/tests/java/mod/_forms')
24 files changed, 98 insertions, 101 deletions
diff --git a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java index 83a563496581..f12e2c73e399 100644 --- a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java +++ b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java @@ -152,7 +152,7 @@ public class GenericModelTest extends TestCase { * myProp.Value = "My special Value"; * m_propertiesToSet.add(myProp); */ - public static ArrayList m_propertiesToSet = new ArrayList(); + public static ArrayList<NamedValue> m_propertiesToSet = new ArrayList<NamedValue>(); /** * This variable contains the name of the property which should be changed while @@ -278,14 +278,14 @@ public class GenericModelTest extends TestCase { log.println("closing data source..."); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, m_dbSrc); if ( closer == null ) { - XDocumentDataSource dataSource = (XDocumentDataSource)UnoRuntime.queryInterface( + XDocumentDataSource dataSource = UnoRuntime.queryInterface( XDocumentDataSource.class, m_dbSrc); if ( dataSource != null ) - closer = (XCloseable) UnoRuntime.queryInterface( + closer = UnoRuntime.queryInterface( XCloseable.class, dataSource.getDatabaseDocument() ); } if (debug && closer==null){ @@ -302,7 +302,7 @@ public class GenericModelTest extends TestCase { log.println("disposing data source..."); try { - XComponent dataSourceComp = (XComponent)UnoRuntime.queryInterface( + XComponent dataSourceComp = UnoRuntime.queryInterface( XComponent.class, m_dbSrc); dataSourceComp.dispose(); } @@ -313,7 +313,7 @@ public class GenericModelTest extends TestCase { log.println("closing document..."); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, m_xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -537,9 +537,9 @@ public class GenericModelTest extends TestCase { } public void commit() throws com.sun.star.sdbc.SQLException { - XBoundComponent bound = (XBoundComponent) UnoRuntime.queryInterface( + XBoundComponent bound = UnoRuntime.queryInterface( XBoundComponent.class, ctrl); - XResultSetUpdate update = (XResultSetUpdate) UnoRuntime.queryInterface( + XResultSetUpdate update = UnoRuntime.queryInterface( XResultSetUpdate.class, formLoaderF); diff --git a/qadevOOo/tests/java/mod/_forms/OButtonControl.java b/qadevOOo/tests/java/mod/_forms/OButtonControl.java index a6c554e54564..323dfc372f70 100644 --- a/qadevOOo/tests/java/mod/_forms/OButtonControl.java +++ b/qadevOOo/tests/java/mod/_forms/OButtonControl.java @@ -104,7 +104,7 @@ public class OButtonControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -170,7 +170,7 @@ public class OButtonControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -203,7 +203,7 @@ public class OButtonControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java b/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java index abb3a0b25d10..93a57f04d484 100644 --- a/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java @@ -112,7 +112,7 @@ public class OCheckBoxControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -177,7 +177,7 @@ public class OCheckBoxControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class,xTextDoc.getCurrentController()); //now get the OButtonControl @@ -209,14 +209,13 @@ public class OCheckBoxControl extends TestCase { // Adding relation for XItemListener ifc.awt._XItemListener.TestItemListener listener = new ifc.awt._XItemListener.TestItemListener() ; - XCheckBox box = (XCheckBox) UnoRuntime.queryInterface + XCheckBox box = UnoRuntime.queryInterface (XCheckBox.class, oObj) ; box.addItemListener(listener) ; tEnv.addObjRelation("TestItemListener", listener) ; // Adding relation for XWindow - XWindow forObjRel = (XWindow) - UnoRuntime.queryInterface(XWindow.class,aControl); + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class,aControl); tEnv.addObjRelation("XWindow.AnotherWindow",forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java b/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java index 9d7f68ad02aa..abd7dcede6de 100644 --- a/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java @@ -116,7 +116,7 @@ public class OComboBoxControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -182,7 +182,7 @@ public class OComboBoxControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -216,7 +216,7 @@ public class OComboBoxControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -225,7 +225,7 @@ public class OComboBoxControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java b/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java index bfa1d0a85efc..14b23c1621b0 100644 --- a/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java +++ b/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java @@ -116,7 +116,7 @@ public class OCurrencyControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -185,7 +185,7 @@ public class OCurrencyControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -223,7 +223,7 @@ public class OCurrencyControl extends TestCase { tEnv.addObjRelation("XTextComponent.onlyNumbers", new Object()); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -232,7 +232,7 @@ public class OCurrencyControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java index d9424522eb08..7f3fa6568af9 100644 --- a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java +++ b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java @@ -316,7 +316,7 @@ public class ODatabaseForm extends TestCase { PrintWriter log) { if (xTextDoc != null) { try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -401,12 +401,12 @@ public class ODatabaseForm extends TestCase { log.println("Elements in the 'MyForm' :"); - XIndexAccess formElements1 = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess formElements1 = UnoRuntime.queryInterface( XIndexAccess.class, forms.getByName("MyForm")); for (int i = 0; i < formElements1.getCount(); i++) { - XNamed elemName = (XNamed) UnoRuntime.queryInterface( + XNamed elemName = UnoRuntime.queryInterface( XNamed.class, formElements1.getByIndex(i)); log.println(" '" + elemName.getName() + "'"); @@ -443,12 +443,12 @@ public class ODatabaseForm extends TestCase { try { log.println("Elements in the 'MyForm' :"); - XIndexAccess formElements1 = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess formElements1 = UnoRuntime.queryInterface( XIndexAccess.class, forms.getByName("MyForm")); for (int i = 0; i < formElements1.getCount(); i++) { - XNamed elemName = (XNamed) UnoRuntime.queryInterface( + XNamed elemName = UnoRuntime.queryInterface( XNamed.class, formElements1.getByIndex(i)); log.println(" '" + elemName.getName() + "'"); @@ -490,7 +490,7 @@ public class ODatabaseForm extends TestCase { // adding relation for XSubmit XControlModel the_Model = shape2.getControl(); - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); XControl cntrl = null; @@ -505,7 +505,7 @@ public class ODatabaseForm extends TestCase { throw new StatusException("Couldn't get OEditControl", e); } - XResultSet the_set = (XResultSet) UnoRuntime.queryInterface( + XResultSet the_set = UnoRuntime.queryInterface( XResultSet.class, oObj); try { @@ -567,12 +567,12 @@ public class ODatabaseForm extends TestCase { } // Adding obj relation for XRowSetApproveBroadcaster test - final XResultSet xResSet = (XResultSet) UnoRuntime.queryInterface( + final XResultSet xResSet = UnoRuntime.queryInterface( XResultSet.class, oObj); - final XResultSetUpdate xResSetUpdate = (XResultSetUpdate) UnoRuntime.queryInterface( + final XResultSetUpdate xResSetUpdate = UnoRuntime.queryInterface( XResultSetUpdate.class, oObj); - final XRowSet xRowSet = (XRowSet) UnoRuntime.queryInterface( + final XRowSet xRowSet = UnoRuntime.queryInterface( XRowSet.class, oObj); final PrintWriter logF = log; tEnv.addObjRelation("XRowSetApproveBroadcaster.ApproveChecker", @@ -591,7 +591,7 @@ public class ODatabaseForm extends TestCase { try { xResSet.first(); - XRowUpdate row = (XRowUpdate) UnoRuntime.queryInterface( + XRowUpdate row = UnoRuntime.queryInterface( XRowUpdate.class, xResSet); row.updateString(1, "1"); xResSetUpdate.updateRow(); @@ -622,7 +622,7 @@ public class ODatabaseForm extends TestCase { tEnv.addObjRelation("XColumnLocate.ColumnName", DBTools.TST_STRING_F); // Adding relation for XParameters ifc test - ArrayList params = new ArrayList(); + ArrayList<Object> params = new ArrayList<Object>(); /***** statement parameter types and their initial @@ -674,9 +674,9 @@ public class ODatabaseForm extends TestCase { } // Adding relation for XResultSetUpdate - final XRowUpdate xRowUpdate = (XRowUpdate) UnoRuntime.queryInterface( + final XRowUpdate xRowUpdate = UnoRuntime.queryInterface( XRowUpdate.class, oObj); - final XRow xRow = (XRow) UnoRuntime.queryInterface(XRow.class, oObj); + final XRow xRow = UnoRuntime.queryInterface(XRow.class, oObj); tEnv.addObjRelation("XResultSetUpdate.UpdateTester", new ifc.sdbc._XResultSetUpdate.UpdateTester() { @@ -712,7 +712,7 @@ public class ODatabaseForm extends TestCase { // Adding relations for XRow as a Vector with all data // of current row of RowSet. - ArrayList rowData = new ArrayList(); + ArrayList<Object> rowData = new ArrayList<Object>(); for (int i = 0; i < DBTools.TST_TABLE_VALUES[0].length; i++) { rowData.add(DBTools.TST_TABLE_VALUES[0][i]); @@ -721,7 +721,7 @@ public class ODatabaseForm extends TestCase { tEnv.addObjRelation("CurrentRowData", rowData); // Adding relation for XRowUpdate - XRow row = (XRow) UnoRuntime.queryInterface(XRow.class, oObj); + XRow row = UnoRuntime.queryInterface(XRow.class, oObj); tEnv.addObjRelation("XRowUpdate.XRow", row); @@ -753,7 +753,7 @@ public class ODatabaseForm extends TestCase { log.println("closing data source..."); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, dbSrc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -766,7 +766,7 @@ public class ODatabaseForm extends TestCase { log.println("closing document..."); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { diff --git a/qadevOOo/tests/java/mod/_forms/ODateControl.java b/qadevOOo/tests/java/mod/_forms/ODateControl.java index a2862765bc00..b8a146ccf1bf 100644 --- a/qadevOOo/tests/java/mod/_forms/ODateControl.java +++ b/qadevOOo/tests/java/mod/_forms/ODateControl.java @@ -115,7 +115,7 @@ public class ODateControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -181,7 +181,7 @@ public class ODateControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -215,7 +215,7 @@ public class ODateControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -224,7 +224,7 @@ public class ODateControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/OEditControl.java b/qadevOOo/tests/java/mod/_forms/OEditControl.java index 58ff894b6a7a..fcf64d281c98 100644 --- a/qadevOOo/tests/java/mod/_forms/OEditControl.java +++ b/qadevOOo/tests/java/mod/_forms/OEditControl.java @@ -116,7 +116,7 @@ public class OEditControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -191,7 +191,7 @@ public class OEditControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -225,11 +225,11 @@ public class OEditControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // relations for XChangeBroadcaster - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("Win1", - (XWindow) UnoRuntime.queryInterface(XWindow.class, + UnoRuntime.queryInterface(XWindow.class, oObj)); tEnv.addObjRelation("Win2", forObjRel); tEnv.addObjRelation("CONTROL", aControl); @@ -242,7 +242,7 @@ public class OEditControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/OFileControlModel.java b/qadevOOo/tests/java/mod/_forms/OFileControlModel.java index 4f3cd3e6f3d9..509d22fd0821 100644 --- a/qadevOOo/tests/java/mod/_forms/OFileControlModel.java +++ b/qadevOOo/tests/java/mod/_forms/OFileControlModel.java @@ -115,7 +115,7 @@ public class OFileControlModel extends TestCase { log.println(" disposing xDrawDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDrawDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -154,7 +154,7 @@ public class OFileControlModel extends TestCase { XControlModel aControl = null; //get MSF - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, xDrawDoc); @@ -163,9 +163,9 @@ public class OFileControlModel extends TestCase { "com.sun.star.drawing.ControlShape"); Object aCon = oDocMSF.createInstance( "com.sun.star.form.component." + objName); - aControl = (XControlModel) UnoRuntime.queryInterface( + aControl = UnoRuntime.queryInterface( XControlModel.class, aCon); - aShape = (XControlShape) UnoRuntime.queryInterface( + aShape = UnoRuntime.queryInterface( XControlShape.class, oInt); size.Height = 1500; size.Width = 3000; diff --git a/qadevOOo/tests/java/mod/_forms/OFormattedControl.java b/qadevOOo/tests/java/mod/_forms/OFormattedControl.java index 504275adefed..04f3d4353480 100644 --- a/qadevOOo/tests/java/mod/_forms/OFormattedControl.java +++ b/qadevOOo/tests/java/mod/_forms/OFormattedControl.java @@ -112,7 +112,7 @@ public class OFormattedControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -178,7 +178,7 @@ public class OFormattedControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -212,7 +212,7 @@ public class OFormattedControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -221,7 +221,7 @@ public class OFormattedControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/OFormsCollection.java b/qadevOOo/tests/java/mod/_forms/OFormsCollection.java index 0753cc577423..a0554eb987cc 100644 --- a/qadevOOo/tests/java/mod/_forms/OFormsCollection.java +++ b/qadevOOo/tests/java/mod/_forms/OFormsCollection.java @@ -87,7 +87,7 @@ public class OFormsCollection extends TestCase { log.println(" disposing xDrawDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDrawDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -147,7 +147,7 @@ public class OFormsCollection extends TestCase { // INSTANCEn : _XNameContainer; _XNameReplace log.println("adding INSTANCEn as obj relation to environment"); - XComponent xComp = (XComponent) UnoRuntime.queryInterface( + XComponent xComp = UnoRuntime.queryInterface( XComponent.class, xDrawDoc); int THRCNT = 1; if (Param.get("THRCNT")!= null) { diff --git a/qadevOOo/tests/java/mod/_forms/OGridControlModel.java b/qadevOOo/tests/java/mod/_forms/OGridControlModel.java index 266a3582b224..7fe48a4d8c27 100644 --- a/qadevOOo/tests/java/mod/_forms/OGridControlModel.java +++ b/qadevOOo/tests/java/mod/_forms/OGridControlModel.java @@ -180,7 +180,7 @@ public class OGridControlModel extends GenericModelTest { XPropertySet aControl5 = null; try { - XGridColumnFactory columns = (XGridColumnFactory) UnoRuntime.queryInterface( + XGridColumnFactory columns = UnoRuntime.queryInterface( XGridColumnFactory.class, oObj); aControl = columns.createColumn("TextField"); aControl2 = columns.createColumn("DateField"); @@ -229,9 +229,9 @@ public class OGridControlModel extends GenericModelTest { tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XNamed named1 = (XNamed) UnoRuntime.queryInterface( + XNamed named1 = UnoRuntime.queryInterface( XNamed.class, o1); - XNamed named2 = (XNamed) UnoRuntime.queryInterface( + XNamed named2 = UnoRuntime.queryInterface( XNamed.class, o2); if (named1.getName().equals(named2.getName())) { @@ -284,7 +284,7 @@ class OGridControlModelold extends TestCase { log.println(" disposing xDrawDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDrawDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -343,7 +343,7 @@ class OGridControlModelold extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); try { - columns = (XGridColumnFactory) UnoRuntime.queryInterface( + columns = UnoRuntime.queryInterface( XGridColumnFactory.class, oObj); aControl = columns.createColumn("TextField"); aControl2 = columns.createColumn("DateField"); diff --git a/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java b/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java index 8dba76db34cd..483360dc1703 100644 --- a/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java @@ -94,7 +94,7 @@ public class OGroupBoxControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -160,7 +160,7 @@ public class OGroupBoxControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); diff --git a/qadevOOo/tests/java/mod/_forms/OHiddenModel.java b/qadevOOo/tests/java/mod/_forms/OHiddenModel.java index 01d4fe2b292a..c5c63f71d67a 100644 --- a/qadevOOo/tests/java/mod/_forms/OHiddenModel.java +++ b/qadevOOo/tests/java/mod/_forms/OHiddenModel.java @@ -111,7 +111,7 @@ public class OHiddenModel extends TestCase { log.println(" disposing xDrawDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDrawDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { diff --git a/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java b/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java index e9dacb29ca4f..158e20908bbb 100644 --- a/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java +++ b/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java @@ -99,7 +99,7 @@ public class OImageButtonControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -165,7 +165,7 @@ public class OImageButtonControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -200,7 +200,7 @@ public class OImageButtonControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/OImageControlControl.java b/qadevOOo/tests/java/mod/_forms/OImageControlControl.java index fd4861fff424..8d44556e4788 100644 --- a/qadevOOo/tests/java/mod/_forms/OImageControlControl.java +++ b/qadevOOo/tests/java/mod/_forms/OImageControlControl.java @@ -100,7 +100,7 @@ public class OImageControlControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -166,7 +166,7 @@ public class OImageControlControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -201,7 +201,7 @@ public class OImageControlControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/OListBoxControl.java b/qadevOOo/tests/java/mod/_forms/OListBoxControl.java index 8157d8b68ff5..97dcd97a1f64 100644 --- a/qadevOOo/tests/java/mod/_forms/OListBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OListBoxControl.java @@ -65,7 +65,7 @@ public class OListBoxControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -98,7 +98,7 @@ public class OListBoxControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class,xTextDoc.getCurrentController()); //now get the OListBoxControl @@ -130,16 +130,14 @@ public class OListBoxControl extends TestCase { // Adding relation for XItemListener ifc.awt._XItemListener.TestItemListener listener = new ifc.awt._XItemListener.TestItemListener() ; - final XListBox box = (XListBox) UnoRuntime.queryInterface(XListBox.class, oObj) ; + final XListBox box = UnoRuntime.queryInterface(XListBox.class, oObj) ; box.addItemListener(listener) ; tEnv.addObjRelation("TestItemListener", listener) ; // Adding relation for XWindow - XWindow forObjRel = (XWindow) - UnoRuntime.queryInterface(XWindow.class, anotherCtrl); + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); - XWindow objWin = (XWindow) - UnoRuntime.queryInterface(XWindow.class, oObj); + XWindow objWin = UnoRuntime.queryInterface(XWindow.class, oObj); tEnv.addObjRelation("XWindow.AnotherWindow",forObjRel); tEnv.addObjRelation("XWindow.ControlShape",aShape); diff --git a/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java b/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java index 08222a6d9bdc..e3e1fd35e71b 100644 --- a/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java +++ b/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java @@ -127,7 +127,7 @@ public class ONavigationBarControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -160,7 +160,7 @@ public class ONavigationBarControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/ONumericControl.java b/qadevOOo/tests/java/mod/_forms/ONumericControl.java index b70b275496c2..bb5e52d8b7de 100644 --- a/qadevOOo/tests/java/mod/_forms/ONumericControl.java +++ b/qadevOOo/tests/java/mod/_forms/ONumericControl.java @@ -115,7 +115,7 @@ public class ONumericControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -181,7 +181,7 @@ public class ONumericControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -215,7 +215,7 @@ public class ONumericControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -224,7 +224,7 @@ public class ONumericControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/OPatternControl.java b/qadevOOo/tests/java/mod/_forms/OPatternControl.java index e82e510637f4..bb1037225417 100644 --- a/qadevOOo/tests/java/mod/_forms/OPatternControl.java +++ b/qadevOOo/tests/java/mod/_forms/OPatternControl.java @@ -115,7 +115,7 @@ public class OPatternControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -181,7 +181,7 @@ public class OPatternControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -215,7 +215,7 @@ public class OPatternControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -224,7 +224,7 @@ public class OPatternControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java b/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java index 5a2bfcba397b..30da3081489f 100644 --- a/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java +++ b/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java @@ -103,7 +103,7 @@ public class ORadioButtonControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -169,7 +169,7 @@ public class ORadioButtonControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -203,7 +203,7 @@ public class ORadioButtonControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java b/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java index 3c2c44273bfe..8d014b7ee3b6 100644 --- a/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java +++ b/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java @@ -53,7 +53,7 @@ public class OScrollBarModel extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { diff --git a/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java b/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java index 19c89c134089..ec51dbfa0f2b 100644 --- a/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java +++ b/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java @@ -53,7 +53,7 @@ public class OSpinButtonModel extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { diff --git a/qadevOOo/tests/java/mod/_forms/OTimeControl.java b/qadevOOo/tests/java/mod/_forms/OTimeControl.java index 85dc9370c395..a48259feb66c 100644 --- a/qadevOOo/tests/java/mod/_forms/OTimeControl.java +++ b/qadevOOo/tests/java/mod/_forms/OTimeControl.java @@ -116,7 +116,7 @@ public class OTimeControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -182,7 +182,7 @@ public class OTimeControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -215,7 +215,7 @@ public class OTimeControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -224,7 +224,7 @@ public class OTimeControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); |