diff options
Diffstat (limited to 'qadevOOo/tests/java/mod')
296 files changed, 584 insertions, 771 deletions
diff --git a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java index 3a9bc8e19979..ec2bcc3ed056 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java @@ -145,7 +145,7 @@ public class ConnectionLineAccessibility extends TestCase info[1].Name = "password"; info[1].Value = password; - XPropertySet propSetDBSource = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet propSetDBSource = UnoRuntime.queryInterface( XPropertySet.class, oDBSource); try @@ -248,7 +248,7 @@ public class ConnectionLineAccessibility extends TestCase XNameAccess defContainer = querySuppl.getQueryDefinitions(); - XPropertySet queryProp = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet queryProp = UnoRuntime.queryInterface( XPropertySet.class, newQuery); try @@ -284,7 +284,7 @@ public class ConnectionLineAccessibility extends TestCase "Couldn't set property value")); } - XNameContainer queryContainer = (XNameContainer) UnoRuntime.queryInterface( + XNameContainer queryContainer = UnoRuntime.queryInterface( XNameContainer.class, defContainer); diff --git a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java index 4b5f2f24f414..911abfa5db15 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java @@ -143,7 +143,7 @@ public class JoinViewAccessibility extends TestCase { info[1].Name = "password"; info[1].Value = password; - XPropertySet propSetDBSource = (XPropertySet) UnoRuntime.queryInterface ( + XPropertySet propSetDBSource = UnoRuntime.queryInterface ( XPropertySet.class, oDBSource); try @@ -238,7 +238,7 @@ public class JoinViewAccessibility extends TestCase { XNameAccess defContainer = querySuppl.getQueryDefinitions (); - XPropertySet queryProp = (XPropertySet) UnoRuntime.queryInterface ( + XPropertySet queryProp = UnoRuntime.queryInterface ( XPropertySet.class, newQuery); try @@ -270,7 +270,7 @@ public class JoinViewAccessibility extends TestCase { "Couldn't set property value")); } - XNameContainer queryContainer = (XNameContainer) UnoRuntime.queryInterface ( + XNameContainer queryContainer = UnoRuntime.queryInterface ( XNameContainer.class, defContainer); diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java index 4809692ace7d..a44b25bac07b 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java @@ -107,8 +107,7 @@ public class ODatabaseContext extends TestCase { xMSF = (XMultiServiceFactory)Param.getMSF(); oInterface = xMSF.createInstance( "com.sun.star.sdb.DataSource" ); - XPropertySet xDSProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oInterface) ; + XPropertySet xDSProps = UnoRuntime.queryInterface(XPropertySet.class, oInterface) ; xDSProps.setPropertyValue("URL", "sdbc:dbase:file:///.") ; diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java index ee06840e1d0c..aa4232abffce 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java @@ -157,13 +157,12 @@ public class ODatabaseSource extends TestCase { throw new StatusException("Service not available", e) ; } - oObj = (XInterface) xDBDoc.getDataSource(); + oObj = xDBDoc.getDataSource(); log.println("ImplementationName: " + utils.getImplName(oObj)); // Creating new DBase data source in the TEMP directory - XPropertySet xSrcProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet xSrcProp = UnoRuntime.queryInterface(XPropertySet.class, oObj); try{ xSrcProp.setPropertyValue("URL", tmpDatabaseUrl) ; diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java index c55c1571faee..4dff12a7ab9c 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java @@ -267,7 +267,7 @@ public class ODatasourceBrowser extends TestCase { XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000, 10000, "CommandButton"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel shapeModel = aShape.getControl(); diff --git a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java index ab89d5d64d93..2ba6a2cd94a9 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java +++ b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java @@ -83,7 +83,7 @@ public class OQueryDesign extends TestCase { // we use the first datasource XDataSource xDS = null; try { - xNameAccess = (XNameAccess) UnoRuntime.queryInterface( + xNameAccess = UnoRuntime.queryInterface( XNameAccess.class, xMSF.createInstance("com.sun.star.sdb.DatabaseContext")); } catch (Exception ex) { @@ -101,7 +101,7 @@ public class OQueryDesign extends TestCase { throw new StatusException( "Could not get XDataSource", ex ); } try { - xNameAccess = (XNameAccess) UnoRuntime.queryInterface( + xNameAccess = UnoRuntime.queryInterface( XNameAccess.class, xMSF.createInstance("com.sun.star.sdb.DatabaseContext")); } catch (Exception ex) { @@ -149,7 +149,7 @@ public class OQueryDesign extends TestCase { Object oDataSource = null; try{ - XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oDBC); + XNameAccess xNA = UnoRuntime.queryInterface(XNameAccess.class, oDBC); oDataSource = xNA.getByName(sDataSourceName); } catch ( com.sun.star.container.NoSuchElementException e){ throw new StatusException("could not get '" + sDataSourceName + "'" , e) ; @@ -248,7 +248,7 @@ public class OQueryDesign extends TestCase { Object oDataSource = null; try{ - XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oDBC); + XNameAccess xNA = UnoRuntime.queryInterface(XNameAccess.class, oDBC); oDataSource = xNA.getByName(sDataSourceName); } catch ( com.sun.star.container.NoSuchElementException e){ throw new StatusException("could not get '" + sDataSourceName + "'" , e) ; diff --git a/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java b/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java index 592bf708d63b..ef07416e243d 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java +++ b/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java @@ -178,7 +178,7 @@ public class OSingleSelectQueryComposer extends TestCase { try { xMSF = (XMultiServiceFactory)Param.getMSF(); - XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface( + XNameAccess xNameAccess = UnoRuntime.queryInterface( XNameAccess.class, xMSF.createInstance("com.sun.star.sdb.DatabaseContext")); // we use the first datasource @@ -196,7 +196,7 @@ public class OSingleSelectQueryComposer extends TestCase { log.println("Service 'SingleSelectQueryComposer' not supported"); } - oInterface = (XInterface) xConn.createInstance( sServiceNames[0]); + oInterface = xConn.createInstance( sServiceNames[0]); if (oInterface == null) { log.println("Service wasn't created") ; @@ -206,7 +206,7 @@ public class OSingleSelectQueryComposer extends TestCase { Object oRowSet = xMSF.createInstance("com.sun.star.sdb.RowSet") ; - XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface + XPropertySet xSetProp = UnoRuntime.queryInterface (XPropertySet.class, oRowSet) ; xSetProp.setPropertyValue("DataSourceName", "Bibliography") ; diff --git a/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java b/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java index 80b47938362f..c3af86806e0c 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java +++ b/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java @@ -243,7 +243,7 @@ public class SbaXGridControl extends TestCase { XControlModel the_Model = aShape.getControl(); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XLoadable formLoader = FormTools.bindForm(xTextDoc); @@ -285,7 +285,7 @@ public class SbaXGridControl extends TestCase { throw new StatusException("Can't create column instances.", e); } - XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface( + XNameContainer aContainer = UnoRuntime.queryInterface( XNameContainer.class, the_Model); try { @@ -315,7 +315,7 @@ public class SbaXGridControl extends TestCase { aShape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); the_Model = aShape.getControl(); @@ -349,13 +349,9 @@ public class SbaXGridControl extends TestCase { new Object[] { new Integer(0) }, new Object[] { new Integer(1) } }); tEnv.addObjRelation("Comparer", - new Comparator() { - public int compare(Object o1, Object o2) { - return ((Integer) o1).compareTo((Integer)o2); - } - - public boolean equals(Object obj) { - return compare(this, obj) == 0; + new Comparator<Integer>() { + public int compare(Integer o1, Integer o2) { + return o1.compareTo(o2); } }); @@ -396,7 +392,7 @@ public class SbaXGridControl extends TestCase { // adding relation for XUpdateBroadcaster final XInterface ctrl = oObj; final XLoadable formLoaderF = formLoader; - final XPropertySet ps = (XPropertySet) UnoRuntime.queryInterface( + final XPropertySet ps = UnoRuntime.queryInterface( XPropertySet.class, aControl2); tEnv.addObjRelation("XUpdateBroadcaster.Checker", new ifc.form._XUpdateBroadcaster.UpdateChecker() { @@ -449,7 +445,7 @@ public class SbaXGridControl extends TestCase { "com.sun.star.drawing.ControlShape"); Object aCon = oDocMSF.createInstance( "com.sun.star.form.component.GridControl"); - XPropertySet model_props = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet model_props = UnoRuntime.queryInterface( XPropertySet.class, aCon); model_props.setPropertyValue("DefaultControl", "com.sun.star.form.control.InteractionGridControl"); diff --git a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java index b5e8af28f601..4ea9fe8610db 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java @@ -140,7 +140,7 @@ public class TableWindowAccessibility extends TestCase { info[1].Name = "password"; info[1].Value = password; - XPropertySet propSetDBSource = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet propSetDBSource = UnoRuntime.queryInterface( XPropertySet.class, oDBSource); try { @@ -223,7 +223,7 @@ public class TableWindowAccessibility extends TestCase { XNameAccess defContainer = querySuppl.getQueryDefinitions(); - XPropertySet queryProp = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet queryProp = UnoRuntime.queryInterface( XPropertySet.class, newQuery); try { @@ -250,7 +250,7 @@ public class TableWindowAccessibility extends TestCase { "Couldn't set property value")); } - XNameContainer queryContainer = (XNameContainer) UnoRuntime.queryInterface( + XNameContainer queryContainer = UnoRuntime.queryInterface( XNameContainer.class, defContainer); diff --git a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java index f12e2c73e399..595de1cba38e 100644 --- a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java +++ b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java @@ -388,7 +388,7 @@ public class GenericModelTest extends TestCase { } - WriterTools.getDrawPage(m_xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(m_xTextDoc).add(aShape); oObj = aShape.getControl(); log.println("Implementation name: " + util.utils.getImplName(oObj)); @@ -428,16 +428,16 @@ public class GenericModelTest extends TestCase { log.println("adding shape '" + m_LCShape_Type +"' for DataAwareControlModel test"); aShape = FormTools.createControlShape(m_xTextDoc, 6000, 4500, 15000, 10000, m_LCShape_Type); - WriterTools.getDrawPage(m_xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(m_xTextDoc).add(aShape); - m_XPS = (XPropertySet) UnoRuntime.queryInterface( + m_XPS = UnoRuntime.queryInterface( XPropertySet.class, oObj); int i = 0; NamedValue prop = null; try { for (i = 0; i < m_propertiesToSet.size(); i++){ - prop = (NamedValue) m_propertiesToSet.get(i); + prop = m_propertiesToSet.get(i); log.println("setting property: '"+prop.Name+"' to value '"+prop.Value.toString()+"'"); @@ -480,7 +480,7 @@ public class GenericModelTest extends TestCase { tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true)); // adding relation for XFastPropertySet - java.util.HashSet exclude = new java.util.HashSet(); + java.util.HashSet<String> exclude = new java.util.HashSet<String>(); exclude.add("FormatKey"); tEnv.addObjRelation("XFastPropertySet.ExcludeProps", exclude); diff --git a/qadevOOo/tests/java/mod/_forms/OButtonControl.java b/qadevOOo/tests/java/mod/_forms/OButtonControl.java index 323dfc372f70..53dcd6e4d853 100644 --- a/qadevOOo/tests/java/mod/_forms/OButtonControl.java +++ b/qadevOOo/tests/java/mod/_forms/OButtonControl.java @@ -157,7 +157,7 @@ public class OButtonControl extends TestCase { 4500, 15000, 10000, "CommandButton"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -165,7 +165,7 @@ public class OButtonControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java b/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java index 93a57f04d484..a4434dc88edc 100644 --- a/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java @@ -165,14 +165,14 @@ public class OCheckBoxControl extends TestCase { XControlShape aShape = FormTools.createControlShape( xTextDoc,3000,4500,15000,10000,"CheckBox"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); XControlShape aShape2 = FormTools.createControlShape( xTextDoc,3000,4500,5000,10000,"TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java b/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java index abd7dcede6de..e602e5577034 100644 --- a/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java @@ -169,7 +169,7 @@ public class OComboBoxControl extends TestCase { 4500, 15000, 10000, "ComboBox"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -177,7 +177,7 @@ public class OComboBoxControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java b/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java index 14b23c1621b0..58c16c5963a6 100644 --- a/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java +++ b/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java @@ -172,7 +172,7 @@ public class OCurrencyControl extends TestCase { 4500, 15000, 10000, "CurrencyField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -180,7 +180,7 @@ public class OCurrencyControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java index 7f3fa6568af9..896c590af483 100644 --- a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java +++ b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java @@ -426,8 +426,8 @@ public class ODatabaseForm extends TestCase { 1500, 1000, 1000, "CheckBox"); - oShapes.add((XShape) shape1); - oShapes.add((XShape) shape2); + oShapes.add(shape1); + oShapes.add(shape2); oShapes.add(shape3); } catch (Exception e) { e.printStackTrace(log); @@ -466,7 +466,7 @@ public class ODatabaseForm extends TestCase { xTextDoc))) .getByName("MyForm")); - XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet xSetProp = UnoRuntime.queryInterface( XPropertySet.class, oObj); connection = (XConnection) AnyConverter.toObject( new Type(XConnection.class), @@ -656,7 +656,7 @@ public class ODatabaseForm extends TestCase { // Adding relation for XDatabaseParameterBroadcaster tEnv.addObjRelation("ParameterListenerChecker", new ODatabaseForm.ParameterListenerImpl()); - XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface + XPropertySet xSetProp = UnoRuntime.queryInterface (XPropertySet.class, oObj) ; try { xSetProp.setPropertyValue("DataSourceName", dbSourceName) ; @@ -815,7 +815,7 @@ public class ODatabaseForm extends TestCase { try { for(int i=0; i<count; i++) { log.println("### _XDatabaseParameterBroadcaster.ParameterListenerImpl: Parameter "+i+": "+params.getByIndex(i)); - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, params.getByIndex(i)); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, params.getByIndex(i)); log.println("### _XDatabaseParameterBroadcaster.ParameterListenerImpl: Parameter Name: '"+xProp.getPropertyValue("Name") + "' is set to Value '1'"); xProp.setPropertyValue("Value", new Integer(1)); listenerWasCalled = true; @@ -874,7 +874,7 @@ public class ODatabaseForm extends TestCase { Object aObject = params.getByIndex(i); Any any = (Any)aObject; log.println("### _XCompletedExecution.InteractionHandlerImpl: Parameter "+i+": "+params.getByIndex(i)); - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, params.getByIndex(i)); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, params.getByIndex(i)); log.println("### _XCompletedExecution.InteractionHandlerImpl: Parameter Name: '"+xProp.getPropertyValue("Name") + "' is set to Value '1'"); xProp.setPropertyValue("Value", new Integer(1)); handlerWasUsed = true; diff --git a/qadevOOo/tests/java/mod/_forms/ODateControl.java b/qadevOOo/tests/java/mod/_forms/ODateControl.java index b8a146ccf1bf..4f05c4b93e87 100644 --- a/qadevOOo/tests/java/mod/_forms/ODateControl.java +++ b/qadevOOo/tests/java/mod/_forms/ODateControl.java @@ -168,7 +168,7 @@ public class ODateControl extends TestCase { 4500, 15000, 10000, "DateField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -176,7 +176,7 @@ public class ODateControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OEditControl.java b/qadevOOo/tests/java/mod/_forms/OEditControl.java index fcf64d281c98..e7f84e055794 100644 --- a/qadevOOo/tests/java/mod/_forms/OEditControl.java +++ b/qadevOOo/tests/java/mod/_forms/OEditControl.java @@ -178,7 +178,7 @@ public class OEditControl extends TestCase { 4500, 15000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -186,7 +186,7 @@ public class OEditControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OFileControlModel.java b/qadevOOo/tests/java/mod/_forms/OFileControlModel.java index 509d22fd0821..748ef1c56e65 100644 --- a/qadevOOo/tests/java/mod/_forms/OFileControlModel.java +++ b/qadevOOo/tests/java/mod/_forms/OFileControlModel.java @@ -181,7 +181,7 @@ public class OFileControlModel extends TestCase { aShape.setControl(aControl); - DrawTools.getDrawPage(xDrawDoc, 0).add((XShape) aShape); + DrawTools.getDrawPage(xDrawDoc, 0).add(aShape); oObj = aShape.getControl(); log.println("creating a new environment for drawpage object"); diff --git a/qadevOOo/tests/java/mod/_forms/OFormattedControl.java b/qadevOOo/tests/java/mod/_forms/OFormattedControl.java index 04f3d4353480..ebeb6ac91dd1 100644 --- a/qadevOOo/tests/java/mod/_forms/OFormattedControl.java +++ b/qadevOOo/tests/java/mod/_forms/OFormattedControl.java @@ -165,7 +165,7 @@ public class OFormattedControl extends TestCase { 4500, 15000, 10000, "FormattedField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -173,7 +173,7 @@ public class OFormattedControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OGridControlModel.java b/qadevOOo/tests/java/mod/_forms/OGridControlModel.java index 7fe48a4d8c27..84680fa1878a 100644 --- a/qadevOOo/tests/java/mod/_forms/OGridControlModel.java +++ b/qadevOOo/tests/java/mod/_forms/OGridControlModel.java @@ -193,7 +193,7 @@ public class OGridControlModel extends GenericModelTest { throw new StatusException("Can't create column instances.", e); } - XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface( + XNameContainer aContainer = UnoRuntime.queryInterface( XNameContainer.class, oObj); try { @@ -227,7 +227,7 @@ public class OGridControlModel extends GenericModelTest { tEnv.addObjRelation("Comparer", - new Comparator() { + new Comparator<Object>() { public int compare(Object o1, Object o2) { XNamed named1 = UnoRuntime.queryInterface( XNamed.class, o1); @@ -240,10 +240,6 @@ public class OGridControlModel extends GenericModelTest { return -1; } - - public boolean equals(Object obj) { - return compare(this, obj) == 0; - } }); @@ -356,7 +352,7 @@ class OGridControlModelold extends TestCase { throw new StatusException("Can't create column instances.", e); } - XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface( + XNameContainer aContainer = UnoRuntime.queryInterface( XNameContainer.class, oObj); try { diff --git a/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java b/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java index 483360dc1703..3c04ab70ceec 100644 --- a/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java @@ -147,7 +147,7 @@ public class OGroupBoxControl extends TestCase { 7000, 2000, 2000, "GroupBox"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -155,7 +155,7 @@ public class OGroupBoxControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OHiddenModel.java b/qadevOOo/tests/java/mod/_forms/OHiddenModel.java index c5c63f71d67a..e59d6acd74ba 100644 --- a/qadevOOo/tests/java/mod/_forms/OHiddenModel.java +++ b/qadevOOo/tests/java/mod/_forms/OHiddenModel.java @@ -153,7 +153,7 @@ public class OHiddenModel extends TestCase { Object frm = nc.getByName("OHiddenModelForm"); - XNameContainer frmNC = (XNameContainer) UnoRuntime.queryInterface( + XNameContainer frmNC = UnoRuntime.queryInterface( XNameContainer.class, frm); frmNC.insertByName("OHiddenModel", ctrl); diff --git a/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java b/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java index 158e20908bbb..48e05ee3a60f 100644 --- a/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java +++ b/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java @@ -152,7 +152,7 @@ public class OImageButtonControl extends TestCase { 4500, 15000, 10000, "ImageButton"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -160,7 +160,7 @@ public class OImageButtonControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OImageControlControl.java b/qadevOOo/tests/java/mod/_forms/OImageControlControl.java index 8d44556e4788..6f0db7c3119e 100644 --- a/qadevOOo/tests/java/mod/_forms/OImageControlControl.java +++ b/qadevOOo/tests/java/mod/_forms/OImageControlControl.java @@ -153,7 +153,7 @@ public class OImageControlControl extends TestCase { xTextDoc, 3000, 4500, 15000, 10000, "DatabaseImageControl"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -161,7 +161,7 @@ public class OImageControlControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OListBoxControl.java b/qadevOOo/tests/java/mod/_forms/OListBoxControl.java index 97dcd97a1f64..bdf3cddf71cb 100644 --- a/qadevOOo/tests/java/mod/_forms/OListBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OListBoxControl.java @@ -86,14 +86,14 @@ public class OListBoxControl extends TestCase { XControlShape aShape = FormTools.createControlShape( xTextDoc,3000,4500,15000,10000,"ListBox"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); XControlShape aShape2 = FormTools.createControlShape( xTextDoc,3000,4500,5000,10000,"TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OListBoxModel.java b/qadevOOo/tests/java/mod/_forms/OListBoxModel.java index e564e48a888c..c97868f7fb8c 100644 --- a/qadevOOo/tests/java/mod/_forms/OListBoxModel.java +++ b/qadevOOo/tests/java/mod/_forms/OListBoxModel.java @@ -205,9 +205,9 @@ public class OListBoxModel extends GenericModelTest { } public void commit() throws 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/ONavigationBarControl.java b/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java index e3e1fd35e71b..a1b2aa6696dd 100644 --- a/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java +++ b/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java @@ -114,7 +114,7 @@ public class ONavigationBarControl extends TestCase { 4500, 15000, 10000, "NavigationToolBar"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -122,7 +122,7 @@ public class ONavigationBarControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/ONumericControl.java b/qadevOOo/tests/java/mod/_forms/ONumericControl.java index bb5e52d8b7de..10a95a87d9a8 100644 --- a/qadevOOo/tests/java/mod/_forms/ONumericControl.java +++ b/qadevOOo/tests/java/mod/_forms/ONumericControl.java @@ -168,7 +168,7 @@ public class ONumericControl extends TestCase { 4500, 15000, 10000, "NumericField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -176,7 +176,7 @@ public class ONumericControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OPatternControl.java b/qadevOOo/tests/java/mod/_forms/OPatternControl.java index bb1037225417..e50c347eeecf 100644 --- a/qadevOOo/tests/java/mod/_forms/OPatternControl.java +++ b/qadevOOo/tests/java/mod/_forms/OPatternControl.java @@ -168,7 +168,7 @@ public class OPatternControl extends TestCase { 4500, 15000, 10000, "PatternField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -176,7 +176,7 @@ public class OPatternControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java b/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java index 30da3081489f..1c7c90d92e6f 100644 --- a/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java +++ b/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java @@ -156,7 +156,7 @@ public class ORadioButtonControl extends TestCase { 4500, 15000, 10000, "RadioButton"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -164,7 +164,7 @@ public class ORadioButtonControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java b/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java index 8d014b7ee3b6..6eb3f162375f 100644 --- a/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java +++ b/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java @@ -70,7 +70,7 @@ public class OScrollBarModel extends TestCase { XControlShape aShape = FormTools.createControlShape( xTextDoc,3000,4500,15000,10000,"ScrollBar"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); oObj = aShape.getControl(); log.println( "creating a new environment for OScrollBarModel object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java b/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java index ec51dbfa0f2b..74060abc606e 100644 --- a/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java +++ b/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java @@ -75,7 +75,7 @@ public class OSpinButtonModel extends TestCase { XControlShape aShape = FormTools.createControlShape( xTextDoc,3000,4500,15000,10000,"SpinButton"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); oObj = aShape.getControl(); log.println( "creating a new environment for OButtonModel object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_forms/OTimeControl.java b/qadevOOo/tests/java/mod/_forms/OTimeControl.java index a48259feb66c..3104e741e98e 100644 --- a/qadevOOo/tests/java/mod/_forms/OTimeControl.java +++ b/qadevOOo/tests/java/mod/_forms/OTimeControl.java @@ -169,7 +169,7 @@ public class OTimeControl extends TestCase { 4500, 15000, 10000, "TimeField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -177,7 +177,7 @@ public class OTimeControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_forms/OTimeModel.java b/qadevOOo/tests/java/mod/_forms/OTimeModel.java index f5b6b1b36a0b..b5689275dd8d 100644 --- a/qadevOOo/tests/java/mod/_forms/OTimeModel.java +++ b/qadevOOo/tests/java/mod/_forms/OTimeModel.java @@ -164,7 +164,7 @@ public class OTimeModel extends GenericModelTest { PrintWriter log) { TestEnvironment tEnv = super.createTestEnvironment(Param, log); - HashSet exclude = new HashSet(); + HashSet<String> exclude = new HashSet<String>(); exclude.add("FormatKey"); @@ -206,9 +206,9 @@ public class OTimeModel extends GenericModelTest { } 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/_fwk/DispatchRecorder.java b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java index a73b632b0084..2873cb192291 100644 --- a/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java +++ b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java @@ -85,7 +85,7 @@ public class DispatchRecorder extends TestCase { XModel model = UnoRuntime.queryInterface(XModel.class, oDoc); xFrame = model.getCurrentController().getFrame(); - XPropertySet xFramePS = (XPropertySet) UnoRuntime.queryInterface + XPropertySet xFramePS = UnoRuntime.queryInterface (XPropertySet.class, xFrame); XDispatchRecorderSupplier xDRS = null; xDRS = (XDispatchRecorderSupplier) AnyConverter.toObject( @@ -96,8 +96,7 @@ public class DispatchRecorder extends TestCase { Object oDRS = ((XMultiServiceFactory)Param.getMSF()).createInstance( "com.sun.star.comp.framework.DispatchRecorderSupplier"); xFramePS.setPropertyValue("DispatchRecorderSupplier", oDRS); - xDRS = (XDispatchRecorderSupplier) - UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS); + xDRS = UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS); } xDR = xDRS.getDispatchRecorder(); diff --git a/qadevOOo/tests/java/mod/_fwk/Frame.java b/qadevOOo/tests/java/mod/_fwk/Frame.java index a8c9251af74c..570b2063424c 100644 --- a/qadevOOo/tests/java/mod/_fwk/Frame.java +++ b/qadevOOo/tests/java/mod/_fwk/Frame.java @@ -82,7 +82,7 @@ public class Frame extends TestCase { } frame = xTextDoc.getCurrentController().getFrame(); - oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, frame); + oObj = UnoRuntime.queryInterface(XInterface.class, frame); log.println(util.utils.getImplName(oObj)); diff --git a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java index 003dad6e389c..5a4444a6220b 100644 --- a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java +++ b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java @@ -133,10 +133,10 @@ public class JobExecutor extends TestCase { "com.sun.star.configuration.ConfigurationUpdateAccess", args); XHierarchicalNameAccess xHNA = UnoRuntime.queryInterface(XHierarchicalNameAccess.class, oRootCfg); obj = xHNA.getByHierarchicalName("Jobs"); - jobs = (XNameAccess) UnoRuntime.queryInterface + jobs = UnoRuntime.queryInterface (XNameAccess.class, obj); obj = xHNA.getByHierarchicalName("Events"); - events = (XNameAccess) UnoRuntime.queryInterface + events = UnoRuntime.queryInterface (XNameAccess.class, obj); } catch (Exception e) { throw new StatusException("Couldn't get configuration", e); @@ -150,22 +150,18 @@ public class JobExecutor extends TestCase { if (!configured) { try { log.println("Adding configuration to Jobs ..."); - XSingleServiceFactory jobsFac = (XSingleServiceFactory) - UnoRuntime.queryInterface(XSingleServiceFactory.class, jobs); + XSingleServiceFactory jobsFac = UnoRuntime.queryInterface(XSingleServiceFactory.class, jobs); Object oNewJob = jobsFac.createInstance(); XNameReplace xNewJobNR = UnoRuntime.queryInterface(XNameReplace.class, oNewJob); xNewJobNR.replaceByName("Service", "test.Job"); - XNameContainer xJobsNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, jobs); + XNameContainer xJobsNC = UnoRuntime.queryInterface(XNameContainer.class, jobs); xJobsNC.insertByName("TestJob", oNewJob); log.println("Adding configuration to Events ..."); - XSingleServiceFactory eventsFac = (XSingleServiceFactory) - UnoRuntime.queryInterface(XSingleServiceFactory.class, events); + XSingleServiceFactory eventsFac = UnoRuntime.queryInterface(XSingleServiceFactory.class, events); Object oNewEvent = eventsFac.createInstance(); - XNameAccess xNewEventNA = (XNameAccess) - UnoRuntime.queryInterface(XNameAccess.class, oNewEvent); + XNameAccess xNewEventNA = UnoRuntime.queryInterface(XNameAccess.class, oNewEvent); Object oJobList = xNewEventNA.getByName("JobList"); XSingleServiceFactory jobListFac = (XSingleServiceFactory) AnyConverter.toObject(new Type(XSingleServiceFactory.class), @@ -179,8 +175,7 @@ public class JobExecutor extends TestCase { jobListNC.insertByName("TestJob", oNewJobTimeStamps); - XNameContainer xEventsNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, events); + XNameContainer xEventsNC = UnoRuntime.queryInterface(XNameContainer.class, events); xEventsNC.insertByName("TestEvent", oNewEvent); XChangesBatch xCB = UnoRuntime.queryInterface(XChangesBatch.class, oRootCfg); @@ -212,7 +207,7 @@ public class JobExecutor extends TestCase { try { oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( "com.sun.star.comp.framework.JobExecutor"); - job = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance("test.Job"); + job = ((XMultiServiceFactory)Param.getMSF()).createInstance("test.Job"); } catch(com.sun.star.uno.Exception e) { e.printStackTrace(log); throw new StatusException( diff --git a/qadevOOo/tests/java/mod/_fwk/LayoutManager.java b/qadevOOo/tests/java/mod/_fwk/LayoutManager.java index b4b49a37b855..f383d1334723 100644 --- a/qadevOOo/tests/java/mod/_fwk/LayoutManager.java +++ b/qadevOOo/tests/java/mod/_fwk/LayoutManager.java @@ -87,10 +87,10 @@ public class LayoutManager extends TestCase { } XFrame xFrame = xTextDoc.getCurrentController().getFrame(); - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xFrame); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xFrame); try { Object any = xProp.getPropertyValue("LayoutManager"); - xManager = (XInterface)UnoRuntime.queryInterface(XInterface.class, any); + xManager = UnoRuntime.queryInterface(XInterface.class, any); } catch(com.sun.star.beans.UnknownPropertyException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java index c46f356d0429..9f4362a89bd2 100644 --- a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java +++ b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java @@ -90,7 +90,7 @@ public class ModuleUIConfigurationManager extends TestCase { log.println("Creating instance..."); xTextDoc = WriterTools.createTextDoc(xMSF); - Object o = (XInterface)xMSF.createInstance("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"); + Object o = xMSF.createInstance("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"); XModuleUIConfigurationManagerSupplier xMUICMS = UnoRuntime.queryInterface(XModuleUIConfigurationManagerSupplier.class, o); util.dbg.printInterfaces(xMUICMS); @@ -99,12 +99,11 @@ public class ModuleUIConfigurationManager extends TestCase { log.println("TestObject: " + utils.getImplName(oObj)); tEnv = new TestEnvironment(oObj); - XNameAccess xMM = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, xMSF.createInstance("com.sun.star.comp.framework.ModuleManager")); + XNameAccess xMM = UnoRuntime.queryInterface(XNameAccess.class, xMSF.createInstance("com.sun.star.comp.framework.ModuleManager")); String[] names = xMM.getElementNames(); o = xMSF.createInstance("com.sun.star.embed.StorageFactory"); - XSingleServiceFactory xStorageService = (XSingleServiceFactory) - UnoRuntime.queryInterface(XSingleServiceFactory.class, o); + XSingleServiceFactory xStorageService = UnoRuntime.queryInterface(XSingleServiceFactory.class, o); Object[]props = new Object[2]; String aFile = util.utils.getOfficeTempDir(xMSF) + "dummyFile.dat"; diff --git a/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java b/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java index 322091d923d1..cdaf982f72fe 100644 --- a/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java +++ b/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java @@ -85,10 +85,10 @@ public class PopupMenuControllerFactory extends TestCase { log.println("TestObject: " + util.utils.getImplName(xInst)); tEnv = new TestEnvironment(xInst); - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xMSF); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xMSF); try { Object o = xProp.getPropertyValue("DefaultContext"); - XComponentContext xContext = (XComponentContext)UnoRuntime.queryInterface(XComponentContext.class, o); + XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, o); tEnv.addObjRelation("DC", xContext); } catch(com.sun.star.beans.UnknownPropertyException e) { diff --git a/qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java b/qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java index d206d80e167d..1cda12f51897 100644 --- a/qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java +++ b/qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java @@ -44,10 +44,10 @@ public class StatusBarControllerFactory extends TestCase { catch(com.sun.star.uno.Exception e) { throw new StatusException("Cannot create test object 'StatusBarControllerFactory'", e); } - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xMSF); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xMSF); try { Object o = xProp.getPropertyValue("DefaultContext"); - XComponentContext xContext = (XComponentContext)UnoRuntime.queryInterface(XComponentContext.class, o); + XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, o); tEnv.addObjRelation("DC", xContext); } catch(com.sun.star.beans.UnknownPropertyException e) { diff --git a/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java b/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java index 4e41c5a345ca..a53c46374db0 100644 --- a/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java +++ b/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java @@ -81,8 +81,8 @@ public class UIConfigurationManager extends TestCase { String deleteCfg = util.utils.getFullURL(util.utils.getOfficeTemp(xMSF) + "delete.cfg"); util.utils.copyFile(xMSF, sourceDeleteCfg, deleteCfg); XStorage xSubStorage = null; - Object o = (XInterface)xMSF.createInstance("com.sun.star.embed.StorageFactory"); - XSingleServiceFactory xSSF = (XSingleServiceFactory)UnoRuntime.queryInterface( + Object o = xMSF.createInstance("com.sun.star.embed.StorageFactory"); + XSingleServiceFactory xSSF = UnoRuntime.queryInterface( XSingleServiceFactory.class, o); Object[] props = new Object[2]; props[0] = deleteCfg; diff --git a/qadevOOo/tests/java/mod/_fwl/ContentHandlerFactory.java b/qadevOOo/tests/java/mod/_fwl/ContentHandlerFactory.java index 0e6604ed3a4a..9b17a34042c2 100644 --- a/qadevOOo/tests/java/mod/_fwl/ContentHandlerFactory.java +++ b/qadevOOo/tests/java/mod/_fwl/ContentHandlerFactory.java @@ -84,7 +84,7 @@ public class ContentHandlerFactory extends TestCase { log.println( "creating a new environment for object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); - XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface + XNameAccess xNA = UnoRuntime.queryInterface (XNameAccess.class, oObj); tEnv.addObjRelation("XMSF.serviceNames", xNA.getElementNames()); String[] dummy = xNA.getElementNames(); diff --git a/qadevOOo/tests/java/mod/_fwl/FilterFactory.java b/qadevOOo/tests/java/mod/_fwl/FilterFactory.java index bedbb6a9e4c3..0e105af4b6a1 100644 --- a/qadevOOo/tests/java/mod/_fwl/FilterFactory.java +++ b/qadevOOo/tests/java/mod/_fwl/FilterFactory.java @@ -90,7 +90,7 @@ public class FilterFactory extends TestCase { log.println( "creating a new environment for object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); - XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface + XNameAccess xNA = UnoRuntime.queryInterface (XNameAccess.class, oObj); String[] filterNames = xNA.getElementNames(); @@ -101,7 +101,7 @@ public class FilterFactory extends TestCase { try{ instance = (Object[]) xNA.getByName(filterName); PropertyValue[] props = (PropertyValue[]) instance; - instanceProp = (PropertyValue) getPropertyValue + instanceProp = getPropertyValue (((PropertyValue[]) instance), "FilterService"); //instance[9]; } catch (com.sun.star.container.NoSuchElementException e){ throw new StatusException( diff --git a/qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java b/qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java index 85f33899d2c0..4260ac315676 100644 --- a/qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java +++ b/qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java @@ -83,7 +83,7 @@ public class FrameLoaderFactory extends TestCase { log.println( "creating a new environment for object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); - XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface + XNameAccess xNA = UnoRuntime.queryInterface (XNameAccess.class, oObj); tEnv.addObjRelation("XMSF.serviceNames", xNA.getElementNames()); diff --git a/qadevOOo/tests/java/mod/_fwl/PathSettings.java b/qadevOOo/tests/java/mod/_fwl/PathSettings.java index ad9e5ecc2161..6e91ee8363fc 100644 --- a/qadevOOo/tests/java/mod/_fwl/PathSettings.java +++ b/qadevOOo/tests/java/mod/_fwl/PathSettings.java @@ -117,7 +117,7 @@ public class PathSettings extends TestCase { log.println( "creating a new environment for object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); - Set exclProps = new HashSet(); + Set<String> exclProps = new HashSet<String>(); exclProps.add("UIConfig"); tEnv.addObjRelation("XFastPropertySet.ExcludeProps", exclProps); tEnv.addObjRelation("XMultiPropertySet.ExcludeProps", exclProps); @@ -129,7 +129,7 @@ public class PathSettings extends TestCase { private void saveAllPropertyValues(XInterface oObj){ - xPS = (XPropertySet) UnoRuntime.queryInterface( + xPS = UnoRuntime.queryInterface( XPropertySet.class, oObj); XPropertySetInfo xPSI = xPS.getPropertySetInfo(); diff --git a/qadevOOo/tests/java/mod/_fwl/TypeDetection.java b/qadevOOo/tests/java/mod/_fwl/TypeDetection.java index 4f5ad37b75aa..c67e6cef1b12 100644 --- a/qadevOOo/tests/java/mod/_fwl/TypeDetection.java +++ b/qadevOOo/tests/java/mod/_fwl/TypeDetection.java @@ -110,7 +110,7 @@ public class TypeDetection extends TestCase { log.println( "creating a new environment for object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); - XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface + XNameAccess xNA = UnoRuntime.queryInterface (XNameAccess.class, oObj); String[] elementNames = xNA.getElementNames(); String elementName = elementNames[0]; diff --git a/qadevOOo/tests/java/mod/_i18n/BreakIterator.java b/qadevOOo/tests/java/mod/_i18n/BreakIterator.java index 07a3dab8d988..f11572ed809a 100644 --- a/qadevOOo/tests/java/mod/_i18n/BreakIterator.java +++ b/qadevOOo/tests/java/mod/_i18n/BreakIterator.java @@ -96,7 +96,7 @@ public class BreakIterator extends TestCase { XTextDocument xDoc = UnoRuntime.queryInterface (XTextDocument.class, xTextDoc); - XTextRange xTextRange = (XTextRange)xDoc.getText(); + XTextRange xTextRange = xDoc.getText(); tEnv.addObjRelation("UnicodeString", xTextRange.getString()); return tEnv; diff --git a/qadevOOo/tests/java/mod/_lnn/Hyphenator.java b/qadevOOo/tests/java/mod/_lnn/Hyphenator.java index 096c0cfd2cf5..0d89efa13059 100644 --- a/qadevOOo/tests/java/mod/_lnn/Hyphenator.java +++ b/qadevOOo/tests/java/mod/_lnn/Hyphenator.java @@ -82,8 +82,7 @@ public class Hyphenator extends TestCase { ("com.sun.star.linguistic2.Hyphenator"); Object LP = xMSF.createInstance ("com.sun.star.linguistic2.LinguProperties"); - XPropertySet LProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,LP); + XPropertySet LProps = UnoRuntime.queryInterface(XPropertySet.class,LP); LProps.setPropertyValue("IsGermanPreReform",new Boolean(true)); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_pcr/ObjectInspector.java b/qadevOOo/tests/java/mod/_pcr/ObjectInspector.java index 0697b99e2d59..9717505efffe 100644 --- a/qadevOOo/tests/java/mod/_pcr/ObjectInspector.java +++ b/qadevOOo/tests/java/mod/_pcr/ObjectInspector.java @@ -132,7 +132,7 @@ public class ObjectInspector extends TestCase { XInterface oFrame = (XInterface) xMSF.createInstance("com.sun.star.frame.Frame"); - XFrame xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, oFrame); + XFrame xFrame = UnoRuntime.queryInterface(XFrame.class, oFrame); xFrame.setName("ObjectInspector"); xFrame.initialize(xWindow); @@ -187,7 +187,7 @@ public class ObjectInspector extends TestCase { XFrame existentInspector = null; - XFrame xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, StarDesktop); + XFrame xFrame = UnoRuntime.queryInterface(XFrame.class, StarDesktop); existentInspector = xFrame.findFrame( "ObjectInspector", 255 ); diff --git a/qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java b/qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java index 84718294f536..92c2ef81e579 100644 --- a/qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java +++ b/qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java @@ -91,14 +91,14 @@ public class ObjectInspectorModel extends TestCase { XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); - XPropertySet xMSFProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xMSF); + XPropertySet xMSFProp = UnoRuntime.queryInterface(XPropertySet.class, xMSF); XComponentContext xDefaultContext = null; try{ // Get the default context from the office server. Object oDefaultContext = xMSFProp.getPropertyValue("DefaultContext"); // Query for the interface XComponentContext. - xDefaultContext = (XComponentContext) UnoRuntime.queryInterface( + xDefaultContext = UnoRuntime.queryInterface( XComponentContext.class, oDefaultContext); } catch (UnknownPropertyException e){ @@ -148,7 +148,7 @@ public class ObjectInspectorModel extends TestCase { XFrame existentInspector = null; - XFrame xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, StarDesktop); + XFrame xFrame = UnoRuntime.queryInterface(XFrame.class, StarDesktop); existentInspector = xFrame.findFrame( "ObjectInspector", 255 ); diff --git a/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java b/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java index 443bc69957b2..19c33c8f4273 100644 --- a/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java +++ b/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java @@ -78,12 +78,11 @@ public class RegistryTypeDescriptionProvider extends TestCase { try { XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF(); - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet xProp = UnoRuntime.queryInterface( XPropertySet.class, xMSF); // get context - XComponentContext xContext = (XComponentContext) - UnoRuntime.queryInterface(XComponentContext.class, - xProp.getPropertyValue("DefaultContext")); + XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, + xProp.getPropertyValue("DefaultContext")); // get the type description manager Object o = xContext.getValueByName("/singletons/" + "com.sun.star.reflection.theTypeDescriptionManager"); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java index 743e8388cee6..64f34d4acc41 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java @@ -130,9 +130,9 @@ public class ScAccessibleCell extends TestCase { xCell = oSheet.getCellByPosition(1, 0) ; xCell.setFormula(text); XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, oSheet); - XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); + XTableColumns oColumns = oColumnRowRange.getColumns(); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oColumns); - XPropertySet column = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet column = UnoRuntime.queryInterface( XPropertySet.class,oIndexAccess.getByIndex(1)); column.setPropertyValue("OptimalWidth", new Boolean(true)); } catch(com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java index 548b7b94e72e..d3842c014c03 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java @@ -177,8 +177,7 @@ public class ScAccessiblePageHeader extends TestCase { } //get the property-set - final XPropertySet PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + final XPropertySet PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java index 34f86a372354..d7d18f8e2914 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java @@ -182,11 +182,11 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { try { Object oPageStyles = xNA.getByName("PageStyles"); - xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, + xNA = UnoRuntime.queryInterface(XNameAccess.class, oPageStyles); Object oDefStyle = xNA.getByName("Default"); - xPropSet = (XPropertySet) UnoRuntime.queryInterface( + xPropSet = UnoRuntime.queryInterface( XPropertySet.class, oDefStyle); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java index 2cc6362caf6b..fb61f60d32b6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java @@ -123,15 +123,14 @@ public class ScAnnotationObj extends TestCase { log.println("Getting test object ") ; XSpreadsheetDocument xArea = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); - XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); + XSpreadsheets oSheets = xArea.getSheets(); XIndexAccess XAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCell oCell = null; try { XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),XAccess.getByIndex(cellPos.Sheet)); - XCellRange oCRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oCRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); oCell = oCRange.getCellByPosition(cellPos.Column, cellPos.Row); } catch(com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java index c3f8ba5e1ba7..4daf692d73e2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java @@ -135,7 +135,7 @@ public class ScAnnotationShapeObj extends TestCase { XSpreadsheetDocument xArea = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); - XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); + XSpreadsheets oSheets = xArea.getSheets(); XIndexAccess XAccess = UnoRuntime.queryInterface(XIndexAccess.class, @@ -148,8 +148,8 @@ public class ScAnnotationShapeObj extends TestCase { XSpreadsheet.class), XAccess.getByIndex(cellPos.Sheet)); XCellRange oCRange = - (XCellRange) UnoRuntime.queryInterface(XCellRange.class, - oSheet); + UnoRuntime.queryInterface(XCellRange.class, + oSheet); oCell = oCRange.getCellByPosition(cellPos.Column, cellPos.Row); } catch (com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java index bbb2f12bc65b..11171c8f9e4a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java @@ -104,14 +104,13 @@ public class ScAnnotationTextCursor extends TestCase { XSpreadsheetDocument xArea = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); - XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); + XSpreadsheets oSheets = xArea.getSheets(); XIndexAccess XAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet)XAccess.getByIndex(cellPos.Sheet); - XCellRange oCRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oCRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCell oCell = oCRange.getCellByPosition(cellPos.Column, cellPos.Row); diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java index c341d016c67e..17cfffccb73f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java @@ -110,10 +110,9 @@ public class ScAnnotationsObj extends TestCase { log.println("Getting test object ") ; XSpreadsheetDocument xSpreadsheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); - XSpreadsheets sheets = (XSpreadsheets) xSpreadsheetDoc.getSheets(); + XSpreadsheets sheets = xSpreadsheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, sheets ); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, sheets ); XCell oCell = null; XSpreadsheet oSheet = null; try { @@ -121,8 +120,7 @@ public class ScAnnotationsObj extends TestCase { new Type(XSpreadsheet.class), oNames.getByName(oNames.getElementNames()[0])); // adding an annotation... - XCellRange oCRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oCRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); oCell = oCRange.getCellByPosition(10,10); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java index 002ca496ccac..563bd6b4942a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java @@ -108,7 +108,7 @@ public class ScAreaLinkObj extends TestCase { try { // creation of testobject here - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface + XPropertySet props = UnoRuntime.queryInterface (XPropertySet.class, xSheetDoc); XAreaLinks links = (XAreaLinks) AnyConverter.toObject( new Type(XAreaLinks.class),props.getPropertyValue("AreaLinks")) ; diff --git a/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java b/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java index 45bae04e30f0..74f02ca75aae 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java @@ -105,14 +105,14 @@ public class ScAreaLinksObj extends TestCase { try { // creation of testobject here - XPropertySet props = (XPropertySet)UnoRuntime.queryInterface + XPropertySet props = UnoRuntime.queryInterface (XPropertySet.class, xSheetDoc); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),props.getPropertyValue("AreaLinks")) ; XAreaLinks links = null ; // adding one link into collection (for best testing) - links = (XAreaLinks) UnoRuntime.queryInterface(XAreaLinks.class, oObj) ; + links = UnoRuntime.queryInterface(XAreaLinks.class, oObj) ; CellAddress addr = new CellAddress ((short) 1,2,3) ; String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc"); links.insertAtPosition (addr, aSourceArea, "a2:b5", "", "") ; diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java index 411334cf5e2f..0a012a181672 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java @@ -74,7 +74,7 @@ public class ScAutoFormatObj extends TestCase { PrintWriter log) { XInterface oObj = null; - XMultiServiceFactory oMSF = (XMultiServiceFactory)(XMultiServiceFactory)tParam.getMSF(); + XMultiServiceFactory oMSF = (XMultiServiceFactory)tParam.getMSF(); try { XInterface formats = (XInterface)oMSF.createInstance ("com.sun.star.sheet.TableAutoFormats"); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java b/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java index a9a732ac16dd..be5780cd0461 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java @@ -222,7 +222,7 @@ public class ScCellCursorObj extends TestCase { { "", "2", "3", "4" } }); - XPropertySet PropSet = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet PropSet = UnoRuntime.queryInterface( XPropertySet.class, oObj); tEnv.addObjRelation("PropSet", PropSet); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java index 8aa19354cff7..17a60dcd8640 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java @@ -103,7 +103,7 @@ public class ScCellFormatsEnumeration extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java index c6ffccbd1160..37df8a1405f6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java @@ -95,7 +95,7 @@ public class ScCellFormatsObj extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScCellObj.java b/qadevOOo/tests/java/mod/_sc/ScCellObj.java index 51e85aa9006e..c29dbc3e42a1 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellObj.java @@ -194,8 +194,7 @@ public class ScCellObj extends TestCase { // XTextFieldsSupplier tEnv.addObjRelation("SPREADSHEET", xSheetDoc); - XPropertySet PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet PropSet = UnoRuntime.queryInterface(XPropertySet.class, oObj); tEnv.addObjRelation("PropSet",PropSet); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java index c16d4fff4761..ce8154207489 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java @@ -142,7 +142,7 @@ public class ScCellRangeObj extends TestCase { XSpreadsheets oSpreadsheets = UnoRuntime.queryInterface( XSpreadsheetDocument.class, xSheetDoc).getSheets(); - XNameAccess oNames = (XNameAccess) UnoRuntime.queryInterface( + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, oSpreadsheets); XSpreadsheet oSheet = null; @@ -153,7 +153,7 @@ public class ScCellRangeObj extends TestCase { oNames.getByName(oNames.getElementNames()[0])); oObj = oSheet.getCellRangeByPosition(0, 0, 3, 4); - testRange = (XCellRange) UnoRuntime.queryInterface( + testRange = UnoRuntime.queryInterface( XCellRange.class, oObj); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); @@ -189,7 +189,7 @@ public class ScCellRangeObj extends TestCase { tEnv.addObjRelation("XCellRangesQuery.EXPECTEDRESULTS", expectedResults); tEnv.addObjRelation("XCellRangesQuery.CREATEENTRIES", Boolean.TRUE); - XPropertySet PropSet = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet PropSet = UnoRuntime.queryInterface( XPropertySet.class, oObj); tEnv.addObjRelation("PropSet", PropSet); @@ -199,7 +199,7 @@ public class ScCellRangeObj extends TestCase { testRange.getCellByPosition(0,0), testRange.getCellByPosition(0,1)}); } catch(com.sun.star.lang.IndexOutOfBoundsException e){ - e.printStackTrace((PrintWriter)log); + e.printStackTrace(log); log.println("Cannot make required object relation 'XSearchable.MAKEENTRYINCELL'."); } diff --git a/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java index e50a26489464..dc8136008ff5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java @@ -156,8 +156,7 @@ public class ScCellRangesObj extends TestCase { try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), oIndSheets.getByIndex(0)); - XNameContainer oRanges = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oObj); + XNameContainer oRanges = UnoRuntime.queryInterface(XNameContainer.class, oObj); oRange = oSheet.getCellRangeByName("C1:D4"); oRanges.insertByName("Range1", oRange); @@ -225,8 +224,7 @@ public class ScCellRangesObj extends TestCase { tEnv.addObjRelation("INSTANCE" + n, oRange); } - XPropertySet PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet PropSet = UnoRuntime.queryInterface(XPropertySet.class, oObj); tEnv.addObjRelation("PropSet",PropSet); tEnv.addObjRelation("SHEET", oSheet); // add expected results for the XCellRangesQuery interface test diff --git a/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java b/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java index 1708d297bced..cff9e9b9bc6f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java @@ -106,7 +106,7 @@ public class ScCellSearchObj extends TestCase { log.println( "creating a test environment" ); log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java index 7547e35cb464..6bc31581fbe2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java @@ -107,21 +107,21 @@ public class ScCellsEnumeration extends TestCase { XEnumerationAccess oEnum = null; // creation of testobject here - XSpreadsheets oSheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets oSheets = xSheetDoc.getSheets(); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCellRange oSheet = null; try { oSheet = (XCellRange) AnyConverter.toObject( new Type(XCellRange.class),oIndexAccess.getByIndex(0)); - XCell oCell_1 = (XCell)oSheet.getCellByPosition(0, 0); + XCell oCell_1 = oSheet.getCellByPosition(0, 0); XTextRange oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_1); oTextRange.setString("Test string 1"); - XCell oCell_2 = (XCell)oSheet.getCellByPosition(5, 1); + XCell oCell_2 = oSheet.getCellByPosition(5, 1); oCell_2.setValue(15); - XCell oCell_3 = (XCell)oSheet.getCellByPosition(3, 9); + XCell oCell_3 = oSheet.getCellByPosition(3, 9); oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_3); oTextRange.setString("test 2"); cellArr[0] = oCell_1; @@ -143,7 +143,7 @@ public class ScCellsEnumeration extends TestCase { XCellRangesQuery oCellRangesQuery = UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet); XSheetCellRanges oSheetCellRanges = oCellRangesQuery.queryVisibleCells(); - oEnum = (XEnumerationAccess) oSheetCellRanges.getCells(); + oEnum = oSheetCellRanges.getCells(); oObj = oSheetCellRanges.getCells().createEnumeration(); TestEnvironment tEnv = new TestEnvironment(oObj); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellsObj.java index 33efd3dd4916..ac4a5700ddc3 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellsObj.java @@ -101,22 +101,22 @@ public class ScCellsObj extends TestCase { Object cellArr[] = new Object[3]; // creation of testobject here - XSpreadsheets oSheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets oSheets = xSheetDoc.getSheets(); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCellRange oSheet = null; try { oSheet = (XCellRange) AnyConverter.toObject( new Type(XCellRange.class),oIndexAccess.getByIndex(0)); - XCell oCell_1 = (XCell)oSheet.getCellByPosition(0, 0); + XCell oCell_1 = oSheet.getCellByPosition(0, 0); XTextRange oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_1); oTextRange.setString("ScCellsObj test 1"); - XCell oCell_2 = (XCell)oSheet.getCellByPosition(5, 1); + XCell oCell_2 = oSheet.getCellByPosition(5, 1); oCell_2.setValue(15); - XCell oCell_3 = (XCell)oSheet.getCellByPosition(3, 9); + XCell oCell_3 = oSheet.getCellByPosition(3, 9); oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_3); oTextRange.setString("ScCellsObj test 2"); diff --git a/qadevOOo/tests/java/mod/_sc/ScChartObj.java b/qadevOOo/tests/java/mod/_sc/ScChartObj.java index a68749b44f9e..0b84c746b0c5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScChartObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScChartObj.java @@ -197,8 +197,7 @@ public class ScChartObj extends TestCase { Rectangle oRect = new Rectangle(500, 3000, 25000, 11000); - XCellRange oRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScChartsObj.java b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java index baf429e8ef3f..b7b900b0bc65 100644 --- a/qadevOOo/tests/java/mod/_sc/ScChartsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java @@ -204,8 +204,7 @@ public class ScChartsObj extends TestCase { // insert a chart Rectangle oRect = new Rectangle(500, 3000, 25000, 11000); - XCellRange oRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java b/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java index 5c7767ece6d3..6e693850e5ae 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java @@ -150,7 +150,7 @@ public class ScDDELinkObj extends TestCase { } log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -188,8 +188,7 @@ public class ScDDELinkObj extends TestCase { log.println("Getting test object ") ; // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); XNameAccess links = (XNameAccess) AnyConverter.toObject( new Type(XNameAccess.class), UnoRuntime.queryInterface( XNameAccess.class, docProps.getPropertyValue("DDELinks"))); diff --git a/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java b/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java index f2490f3f2bd8..58c2bd061bb6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java @@ -130,7 +130,7 @@ public class ScDDELinksObj extends TestCase { } log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -168,8 +168,7 @@ public class ScDDELinksObj extends TestCase { log.println("Getting test object ") ; // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); oObj = (XInterface)AnyConverter.toObject( new Type(XInterface.class),docProps.getPropertyValue("DDELinks")); log.println("Creating object - " + diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java index df2b4a5cc841..2b7714422ff1 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java @@ -119,7 +119,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase log.println ("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( @@ -227,19 +227,19 @@ public class ScDataPilotFieldGroupItemObj extends TestCase try { Object oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.ROW); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (1); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Function", com.sun.star.sheet.GeneralFunction.SUM); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.DATA); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (2); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.COLUMN); @@ -331,10 +331,10 @@ public class ScDataPilotFieldGroupItemObj extends TestCase { datapilotfield = (XInterface) AnyConverter.toObject ( new Type (XInterface.class), IA.getByIndex (i)); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); + XPropertySet xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { - xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); + xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); XNamed xNamed = UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); System.out.println ("name: "+xNamed.getName ()); dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo"); @@ -342,8 +342,8 @@ public class ScDataPilotFieldGroupItemObj extends TestCase } groups = dpgi.Groups; XIndexAccess groupAccess = UnoRuntime.queryInterface(XIndexAccess.class, groups); - XNameAccess groupNames = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, groupAccess.getByIndex(0)); - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, groupNames.getByName("aName")); + XNameAccess groupNames = UnoRuntime.queryInterface(XNameAccess.class, groupAccess.getByIndex(0)); + oObj = UnoRuntime.queryInterface(XInterface.class, groupNames.getByName("aName")); } catch (Exception e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java index 7f650e391669..2fc1fa4f5bda 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java @@ -118,7 +118,7 @@ public class ScDataPilotFieldGroupObj extends TestCase log.println ("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( @@ -226,19 +226,19 @@ public class ScDataPilotFieldGroupObj extends TestCase try { Object oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.ROW); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (1); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Function", com.sun.star.sheet.GeneralFunction.SUM); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.DATA); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (2); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.COLUMN); @@ -330,10 +330,10 @@ public class ScDataPilotFieldGroupObj extends TestCase { datapilotfield = (XInterface) AnyConverter.toObject ( new Type (XInterface.class), IA.getByIndex (i)); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); + XPropertySet xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { - xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); + xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); XNamed xNamed = UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); System.out.println ("name: "+xNamed.getName ()); dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo"); @@ -341,7 +341,7 @@ public class ScDataPilotFieldGroupObj extends TestCase } groups = dpgi.Groups; XIndexAccess groupAccess = UnoRuntime.queryInterface(XIndexAccess.class, groups); - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, groupAccess.getByIndex(0)); + oObj = UnoRuntime.queryInterface(XInterface.class, groupAccess.getByIndex(0)); } catch (Exception e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java index 7805d7d9ed70..7899d586b068 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java @@ -118,7 +118,7 @@ public class ScDataPilotFieldGroupsObj extends TestCase log.println ("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( @@ -226,19 +226,19 @@ public class ScDataPilotFieldGroupsObj extends TestCase try { Object oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.ROW); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (1); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Function", com.sun.star.sheet.GeneralFunction.SUM); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.DATA); oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (2); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface ( + fieldPropSet = UnoRuntime.queryInterface ( XPropertySet.class, oDataPilotField); fieldPropSet.setPropertyValue ("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.COLUMN); @@ -330,10 +330,10 @@ public class ScDataPilotFieldGroupsObj extends TestCase { datapilotfield = (XInterface) AnyConverter.toObject ( new Type (XInterface.class), IA.getByIndex (i)); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); + XPropertySet xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i)); if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { - xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); + xPropertySet = UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); XNamed xNamed = UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); System.out.println ("name: "+xNamed.getName ()); dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo"); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java index 0e07ddfb1e4f..862cd89cf96a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java @@ -140,7 +140,7 @@ public class ScDataPilotFieldObj extends TestCase { log.println("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface( @@ -223,7 +223,7 @@ public class ScDataPilotFieldObj extends TestCase { try { Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface( + fieldPropSet = UnoRuntime.queryInterface( XPropertySet.class, oDataPilotField); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(); @@ -320,7 +320,7 @@ public class ScDataPilotFieldObj extends TestCase { if (!name.equals("Data")) { fieldsNames[cnt] = name; - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet props = UnoRuntime.queryInterface( XPropertySet.class, field); try { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java index dd91506fc6fe..2b5573ee41db 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java @@ -110,7 +110,7 @@ public class ScDataPilotFieldsObj extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java index eec1c97364ff..7bb82070f96c 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java @@ -141,7 +141,7 @@ public class ScDataPilotItemObj extends TestCase { log.println("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface( @@ -224,7 +224,7 @@ public class ScDataPilotItemObj extends TestCase { try { Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface( + fieldPropSet = UnoRuntime.queryInterface( XPropertySet.class, oDataPilotField); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(); @@ -287,7 +287,7 @@ public class ScDataPilotItemObj extends TestCase { XIndexAccess xIA = xDataPilotField.getItems(); try { - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, + oObj = UnoRuntime.queryInterface(XInterface.class, xIA.getByIndex(0)); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { log.println("Couldn't get DataPilotItemObj"); @@ -338,7 +338,7 @@ public class ScDataPilotItemObj extends TestCase { if (!name.equals("Data")) { fieldsNames[cnt] = name; - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet props = UnoRuntime.queryInterface( XPropertySet.class, field); try { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java index 60f40eefa7b8..804c3a255fe2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java @@ -141,7 +141,7 @@ public class ScDataPilotItemsObj extends TestCase { log.println("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface( @@ -224,7 +224,7 @@ public class ScDataPilotItemsObj extends TestCase { try { Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface( + fieldPropSet = UnoRuntime.queryInterface( XPropertySet.class, oDataPilotField); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(); @@ -326,7 +326,7 @@ public class ScDataPilotItemsObj extends TestCase { if (!name.equals("Data")) { fieldsNames[cnt] = name; - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet props = UnoRuntime.queryInterface( XPropertySet.class, field); try { diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java index e5301fe94080..19ee1dcc47ea 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java @@ -206,8 +206,7 @@ public class ScDataPilotTableObj extends TestCase { XPropertySet fieldPropSet = null; try { Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0); - fieldPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oDataPilotField); + fieldPropSet = UnoRuntime.queryInterface(XPropertySet.class, oDataPilotField); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); throw new StatusException("Couldn't create a test environment", e); @@ -293,7 +292,7 @@ public class ScDataPilotTableObj extends TestCase { for (int i = 0; i < fieldCount; ++i) { Object o = xIA.getByIndex(i); - XPropertySet fieldPropSet = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet fieldPropSet = UnoRuntime.queryInterface( XPropertySet.class, o); if (i == fieldCount - 1) diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java index a4afcd727729..9ff3ebbf1fa7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java @@ -117,7 +117,7 @@ public class ScDataPilotTablesObj extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java index 80a614fb7e4e..a63d9222a512 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java @@ -130,7 +130,7 @@ public class ScDatabaseRangeObj extends TestCase { log.println("Getting test object "); - XPropertySet docProps = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet docProps = UnoRuntime.queryInterface( XPropertySet.class, xSheetDoc); XSpreadsheets sheets = xSheetDoc.getSheets(); @@ -172,7 +172,7 @@ public class ScDatabaseRangeObj extends TestCase { CellRangeAddress aRange = null; //dbRanges.addNewByName("dbRange", aRange); - XNameAccess dbrNA = (XNameAccess) UnoRuntime.queryInterface( + XNameAccess dbrNA = UnoRuntime.queryInterface( XNameAccess.class, dbRanges); XNamed xNamed = null; @@ -218,7 +218,7 @@ public class ScDatabaseRangeObj extends TestCase { try { Object sheet = sheets.getByName(names[0]); - xCellRange = (XCellRange) UnoRuntime.queryInterface( + xCellRange = UnoRuntime.queryInterface( XCellRange.class, sheet); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java index 915579e496f4..f60cd1638de7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java @@ -104,8 +104,7 @@ public class ScDatabaseRangesObj extends TestCase { log.println( "Creating a test environment" ); log.println("Getting test object ") ; - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); XDatabaseRanges dbRanges = null; try { diff --git a/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java index ea4bf9c9b0ef..77692adb089f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java @@ -104,7 +104,7 @@ public class ScDrawPageObj extends TestCase { try { log.println( "getting Drawpages" ); XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDoc); - oDP = (XDrawPages) oDPS.getDrawPages(); + oDP = oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); oObj = (XDrawPage) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java b/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java index f2ae638a3fb8..f25557e5209a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java @@ -109,7 +109,7 @@ public class ScDrawPagesObj extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpages" ); XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xSheetDoc); - oDP = (XDrawPages) oDPS.getDrawPages(); + oDP = oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); oObj = oDP; diff --git a/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java index 8b8daaab782b..4849bfb02e93 100644 --- a/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java @@ -101,7 +101,7 @@ public class ScFilterDescriptorBase extends TestCase { XSheetFilterable SF = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java b/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java index 85cfc2bad05e..7fdf6c586803 100644 --- a/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java @@ -79,7 +79,7 @@ public class ScFunctionDescriptionObj extends TestCase { XInterface FDs = (XInterface)oDocMSF. createInstance("com.sun.star.sheet.FunctionDescriptions"); - XNameAccess NA = (XNameAccess)UnoRuntime.queryInterface + XNameAccess NA = UnoRuntime.queryInterface (XNameAccess.class, FDs); String names[] = NA.getElementNames(); diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java index af8b1d08cbca..799088ea8c49 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java @@ -151,8 +151,7 @@ public class ScHeaderFieldObj extends TestCase { } //get the property-set - PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java index b87925cdfabb..6d2c59aed099 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java @@ -136,8 +136,7 @@ public class ScHeaderFieldsObj extends TestCase { } //get the property-set - PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java index bbadda64e346..88e01a43d616 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java @@ -122,8 +122,7 @@ public class ScHeaderFooterContentObj extends TestCase { } //get the property-set - PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java index 15be879ddf39..007855f82735 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java @@ -161,8 +161,7 @@ public class ScHeaderFooterTextCursor extends TestCase { } //get the property-set - PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java index 530f54120ed1..a937eadd85ff 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java @@ -165,8 +165,7 @@ public class ScHeaderFooterTextObj extends TestCase { } //get the property-set - PropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, StdStyle); + PropSet = UnoRuntime.queryInterface(XPropertySet.class, StdStyle); XHeaderFooterContent RPHC = null; // creation of testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java index edd2911df097..3d3f6bbf4736 100644 --- a/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java @@ -115,14 +115,14 @@ public class ScImportDescriptorBase extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); if (xSpreadsheets == null) log.println("FAILED"); else log.println("OK"); log.println("getting a sheet"); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); + oObj = UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); } catch (Exception e) { throw new StatusException( "Couldn't get a spreadsheet", e); } diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java index dbf755481643..ee7b609377fb 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java @@ -75,7 +75,7 @@ public class ScIndexEnumeration_CellAnnotationsEnumeration extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java index d63546f09d10..96df8bc1f105 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java @@ -78,14 +78,14 @@ public class ScIndexEnumeration_CellAreaLinksEnumeration extends TestCase { try { // creation of testobject here - XPropertySet props = (XPropertySet)UnoRuntime.queryInterface + XPropertySet props = UnoRuntime.queryInterface (XPropertySet.class, xSheetDoc); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),props.getPropertyValue("AreaLinks")) ; XAreaLinks links = null ; // adding one link into collection (for best testing) - links = (XAreaLinks) UnoRuntime.queryInterface(XAreaLinks.class, oObj) ; + links = UnoRuntime.queryInterface(XAreaLinks.class, oObj) ; CellAddress addr = new CellAddress ((short) 1,2,3) ; String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc"); links.insertAtPosition (addr, aSourceArea, "a2:b5", "", "") ; diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java index 66cb82de4e63..0abfc03285e0 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java @@ -100,7 +100,7 @@ public class ScIndexEnumeration_DDELinksEnumeration extends TestCase { } log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -138,8 +138,7 @@ public class ScIndexEnumeration_DDELinksEnumeration extends TestCase { log.println("Getting test object ") ; // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); oObj = (XInterface)AnyConverter.toObject( new Type(XInterface.class),docProps.getPropertyValue("DDELinks")); log.println("Creating object - " + diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java index 734c735f0e61..dfdd517536d9 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java @@ -83,7 +83,7 @@ public class ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java index 3c2e8d8c5707..e8e5a7b097fd 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java @@ -143,7 +143,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration log.println("Getting a sheet"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface( @@ -226,7 +226,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration try { Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0); - fieldPropSet = (XPropertySet) UnoRuntime.queryInterface( + fieldPropSet = UnoRuntime.queryInterface( XPropertySet.class, oDataPilotField); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(); @@ -332,7 +332,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration if (!name.equals("Data")) { fieldsNames[cnt] = name; - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet props = UnoRuntime.queryInterface( XPropertySet.class, field); try { diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java index be0ae0c276ef..eedc7b1c54f7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java @@ -83,7 +83,7 @@ public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java index 0f0b2854ae0b..900c520bd839 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java @@ -77,8 +77,7 @@ public class ScIndexEnumeration_DatabaseRangesEnumeration extends TestCase { log.println( "Creating a test environment" ); log.println("Getting test object ") ; - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); XDatabaseRanges dbRanges = null; try { diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java index 207a7c427a19..c074fd4e15da 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java @@ -75,8 +75,7 @@ public class ScIndexEnumeration_LabelRangesEnumeration extends TestCase { try { log.println("Getting test object ") ; - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java index 1b3165192202..9d9e2cd83590 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java @@ -76,8 +76,7 @@ public class ScIndexEnumeration_NamedRangesEnumeration extends TestCase { log.println("Getting test object "); // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = null; try { ranges = docProps.getPropertyValue("NamedRanges"); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java index a8bd4f0ab663..4b4960e946b8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java @@ -73,7 +73,7 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); @@ -102,8 +102,7 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { } XScenariosSupplier xSupp = UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); - XCellRange oRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java index 0cdbf4821317..865ed59b8fd3 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java @@ -95,8 +95,7 @@ public class ScIndexEnumeration_SheetCellRangesEnumeration extends TestCase { try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndSheets.getByIndex(0)); - XNameContainer oRanges = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oObj); + XNameContainer oRanges = UnoRuntime.queryInterface(XNameContainer.class, oObj); oRange = oSheet.getCellRangeByName("C1:D4"); oRanges.insertByName("Range1", oRange); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java index 823825791feb..261739ad7ed9 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java @@ -102,8 +102,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { com.sun.star.sheet.SheetLinkMode.VALUE); // Getting links. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object links = null; try { @@ -116,7 +115,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { throw new StatusException("Couldn't get SheetLinks", e); } - oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, links); + oObj = UnoRuntime.queryInterface(XInterface.class, links); XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java index ec6601197b1b..88d9d2c5bb53 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java @@ -65,10 +65,9 @@ public class ScIndexEnumeration_SpreadsheetsEnumeration extends TestCase { protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); - XInterface oObj = (XInterface) - UnoRuntime.queryInterface(XInterface.class, xSpreadsheets); + XInterface oObj = UnoRuntime.queryInterface(XInterface.class, xSpreadsheets); log.println("creating a new environment for object"); XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java index 28e3faef0325..dd7dd1bff5a8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java @@ -77,7 +77,7 @@ public class ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java index dad41188204c..478b4a6c9a9b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java @@ -164,8 +164,7 @@ public class ScIndexEnumeration_TableChartsEnumeration extends TestCase { // insert a chart Rectangle oRect = new Rectangle(500, 3000, 25000, 11000); - XCellRange oRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java index a907f195f65b..f1d2617f8169 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java @@ -78,9 +78,8 @@ public class ScIndexEnumeration_TableColumnsEnumeration extends TestCase { log.println("craeting a test environment"); log.println("getting column"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); XSpreadsheet xSpreadsheet = null; try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( @@ -98,7 +97,7 @@ public class ScIndexEnumeration_TableColumnsEnumeration extends TestCase { } XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); + XTableColumns oColumns = oColumnRowRange.getColumns(); oObj = oColumns; log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java index c457d7ef77eb..841490a987f6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java @@ -77,7 +77,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -111,8 +111,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas XPropertySet Props = null; try { - Props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oSheet); + Props = UnoRuntime.queryInterface(XPropertySet.class, oSheet); CFormat = Props.getPropertyValue("ConditionalFormat"); if (utils.isVoid(CFormat)) { log.println("Property 'ConditionalFormat' is void"); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java index 2c12cd2dc40c..c5f310654bdf 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java @@ -75,9 +75,8 @@ public class ScIndexEnumeration_TableRowsEnumeration extends TestCase { log.println("getting row"); XSpreadsheet xSpreadsheet = null; - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), @@ -95,7 +94,7 @@ public class ScIndexEnumeration_TableRowsEnumeration extends TestCase { XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); + XTableRows oRows = oColumnRowRange.getRows(); oObj = oRows; log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java index babd30b14efe..706caacf8370 100644 --- a/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java @@ -100,8 +100,7 @@ public class ScLabelRangeObj extends TestCase { try { log.println("Getting test object ") ; - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); diff --git a/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java index d9db0e49d36d..3fd45f0c6d27 100644 --- a/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java @@ -103,8 +103,7 @@ public class ScLabelRangesObj extends TestCase { try { log.println("Getting test object ") ; - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); diff --git a/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java index a4dd4a158b7f..4de0b49f3300 100644 --- a/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java @@ -109,8 +109,7 @@ public class ScNamedRangeObj extends TestCase { log.println("Getting test object ") ; // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = null; try { diff --git a/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java index 20e24abd113a..f56e6f3b974d 100644 --- a/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java @@ -128,8 +128,7 @@ public class ScNamedRangesObj extends TestCase { } // Getting named ranges. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = null; try { ranges = docProps.getPropertyValue("NamedRanges"); diff --git a/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java b/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java index 4e89e744c1dc..f8ebe1b279d9 100644 --- a/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java @@ -111,8 +111,7 @@ public class ScRecentFunctionsObj extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); // Other parameters required for interface tests - XNameAccess NA = (XNameAccess) - UnoRuntime.queryInterface(XNameAccess.class, allFunctions); + XNameAccess NA = UnoRuntime.queryInterface(XNameAccess.class, allFunctions); tEnv.addObjRelation("FUNCTIONLIST", NA); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java b/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java index 6d8668237226..cb1d42219370 100644 --- a/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java @@ -106,7 +106,7 @@ public class ScScenariosObj extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); @@ -135,8 +135,7 @@ public class ScScenariosObj extends TestCase { } XScenariosSupplier xSupp = UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); - XCellRange oRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java index 9658c523cc7c..94cd1fc0a0d6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java @@ -138,8 +138,7 @@ public class ScSheetLinkObj extends TestCase { SL.link(sURL, "Sheet1", "", "", com.sun.star.sheet.SheetLinkMode.VALUE); // Getting links. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object oLinks = null; try { oLinks = docProps.getPropertyValue("SheetLinks"); @@ -151,8 +150,7 @@ public class ScSheetLinkObj extends TestCase { throw new StatusException("Couldn't get SheetLinks", e); } - XNameAccess links = (XNameAccess) - UnoRuntime.queryInterface(XNameAccess.class, oLinks); + XNameAccess links = UnoRuntime.queryInterface(XNameAccess.class, oLinks); String[] names = links.getElementNames(); diff --git a/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java b/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java index 6ff3902346f1..d069c9f42b56 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java @@ -127,8 +127,7 @@ public class ScSheetLinksObj extends TestCase { com.sun.star.sheet.SheetLinkMode.VALUE); // Getting links. - XPropertySet docProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); + XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object links = null; try { @@ -141,7 +140,7 @@ public class ScSheetLinksObj extends TestCase { throw new StatusException("Couldn't get SheetLinks", e); } - oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, links); + oObj = UnoRuntime.queryInterface(XInterface.class, links); log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); diff --git a/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java index 936bb8c5ffd9..128aba4a14b1 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java @@ -117,14 +117,14 @@ public class ScSortDescriptorBase extends TestCase { // create testobject here log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); if (xSpreadsheets == null) log.println("FAILED"); else log.println("OK"); log.println("getting a sheet"); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); + oObj = UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); } catch (Exception e) { throw new StatusException( "Couldn't get a spreadsheet", e); } diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java index 410535d129db..9e97bd766ceb 100644 --- a/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java @@ -151,9 +151,8 @@ public class ScStyleFamilyObj extends TestCase { SOF.createInstance(xComp,"com.sun.star.style.CellStyle"); // insert a Style which can be replaced by name - XNameContainer oContainer = (XNameContainer) - UnoRuntime.queryInterface( - XNameContainer.class, oStyleFamilyNameAccess); + XNameContainer oContainer = UnoRuntime.queryInterface( + XNameContainer.class, oStyleFamilyNameAccess); try { oContainer.insertByName("ScStyleFamilyObj", oInstance); } catch (com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleObj.java index e5d782628a06..9707e0e567f2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScStyleObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScStyleObj.java @@ -160,9 +160,9 @@ public class ScStyleObj extends TestCase { e.printStackTrace(log); throw new StatusException("Couldn't create instance", e); } - XStyle oMyStyle = (XStyle)UnoRuntime.queryInterface(XStyle.class, oInt); + XStyle oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt); - XNameContainer oStyleFamilyNameContainer = (XNameContainer)UnoRuntime. + XNameContainer oStyleFamilyNameContainer = UnoRuntime. queryInterface(XNameContainer.class, oStyleFamilyNameAccess); try { @@ -208,8 +208,7 @@ public class ScStyleObj extends TestCase { throw new StatusException("Couldn't get spreadsheet by index", e); } - XPropertySet xProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, aCell); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, aCell); try { xProp.setPropertyValue("CellStyle", oMyStyle.getName()); @@ -233,7 +232,7 @@ public class ScStyleObj extends TestCase { tEnv.addObjRelation("PoolStyle", oStyle); tEnv.addObjRelation("PropertyNames", getPropertyNames - ((XPropertySet) UnoRuntime.queryInterface + (UnoRuntime.queryInterface (XPropertySet.class, oMyStyle))); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java index 091d68ad3d80..5139fa458dda 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java @@ -102,7 +102,7 @@ public class ScSubTotalDescriptorBase extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java index 1f5416ab8d99..c6af56ca9ebf 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java @@ -99,7 +99,7 @@ public class ScSubTotalFieldObj extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java index f7fd3415bff5..05d2a2abe717 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java @@ -144,7 +144,7 @@ public class ScTabViewObj extends TestCase { XInterface oObj = aModel.getCurrentController(); log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -181,7 +181,7 @@ public class ScTabViewObj extends TestCase { XCell cell_2 = null; Object cellRange = null; try { - cellRange = (Object)oSheet.getCellRangeByPosition(0, 0, 3, 3); + cellRange = oSheet.getCellRangeByPosition(0, 0, 3, 3); cell_1 = oSheet.getCellByPosition(5,5); cell_2 = oSheet.getCellByPosition(7,7); cell_2.setValue(17.5); @@ -194,7 +194,7 @@ public class ScTabViewObj extends TestCase { Object[] selections = {oSheet, cellRange, cell_1, cell_2}; tEnv.addObjRelation("Selections", selections); - tEnv.addObjRelation("Comparer", new Comparator() { + tEnv.addObjRelation("Comparer", new Comparator<Object>() { public int compare(Object o1, Object o2) { XCellRangeAddressable adr1 = UnoRuntime.queryInterface(XCellRangeAddressable.class, o1); XCellRangeAddressable adr2 = UnoRuntime.queryInterface(XCellRangeAddressable.class, o2); @@ -202,10 +202,7 @@ public class ScTabViewObj extends TestCase { CellRangeAddress range1 = adr1.getRangeAddress(); CellRangeAddress range2 = adr2.getRangeAddress(); return ValueComparer.equalValue(range1, range2) ? 0 : 1 ; - } - public boolean equals(Object obj) { - return compare(this, obj) == 0; - } }); + }}); tEnv.addObjRelation("XUserInputInterception.XModel", aModel); @@ -230,7 +227,7 @@ public class ScTabViewObj extends TestCase { try { log.println( "getting Drawpages" ); XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); - XDrawPages oDP = (XDrawPages) oDPS.getDrawPages(); + XDrawPages oDP = oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); oDrawPage = (XDrawPage) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java b/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java index fd674b3da5ab..68de00f3db29 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java @@ -114,9 +114,8 @@ public class ScTableColumnObj extends TestCase { XSpreadsheet xSpreadsheet = null; - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), @@ -133,7 +132,7 @@ public class ScTableColumnObj extends TestCase { } XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); + XTableColumns oColumns = oColumnRowRange.getColumns(); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oColumns); try { oObj = (XInterface) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java index bdaa454deff5..6f9b9621c9b7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java @@ -107,9 +107,8 @@ public class ScTableColumnsObj extends TestCase { log.println("craeting a test environment"); log.println("getting column"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); XSpreadsheet xSpreadsheet = null; try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( @@ -127,7 +126,7 @@ public class ScTableColumnsObj extends TestCase { } XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); + XTableColumns oColumns = oColumnRowRange.getColumns(); oObj = oColumns; log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java index 5ee191eba153..dbe3d5cca1fc 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java @@ -104,7 +104,7 @@ public class ScTableConditionalEntry extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -138,8 +138,7 @@ public class ScTableConditionalEntry extends TestCase { XPropertySet Props = null; try { - Props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oSheet); + Props = UnoRuntime.queryInterface(XPropertySet.class, oSheet); CFormat = Props.getPropertyValue("ConditionalFormat"); if (utils.isVoid(CFormat)) { log.println("Property 'ConditionalFormat' is void"); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java b/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java index 47b893ad0814..ee764f24f3ef 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java @@ -108,7 +108,7 @@ public class ScTableConditionalFormat extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -137,8 +137,7 @@ public class ScTableConditionalFormat extends TestCase { e.printStackTrace(log); } - XPropertySet Props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oSheet); + XPropertySet Props = UnoRuntime.queryInterface(XPropertySet.class, oSheet); try { oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class), diff --git a/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java b/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java index 91609c52a7f4..9148f1344173 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java @@ -109,16 +109,15 @@ public class ScTableRowObj extends TestCase { log.println("creating a test environment"); XSpreadsheet xSpreadsheet = null; - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), oNames.getByName(oNames.getElementNames()[0])); XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); + XTableRows oRows = oColumnRowRange.getRows(); XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oRows); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),oIndexAccess.getByIndex(6)); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java index 4e4f9276b063..15dadb824487 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java @@ -101,9 +101,8 @@ public class ScTableRowsObj extends TestCase { log.println("getting row"); XSpreadsheet xSpreadsheet = null; - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets(); - XNameAccess oNames = (XNameAccess) - UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); + XNameAccess oNames = UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets ); try { xSpreadsheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), @@ -121,7 +120,7 @@ public class ScTableRowsObj extends TestCase { XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); - XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); + XTableRows oRows = oColumnRowRange.getRows(); oObj = oRows; log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java index 2b053a5c3e8c..0983a263c7b3 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java @@ -187,7 +187,7 @@ public class ScTableSheetObj extends TestCase { log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); log.println("getting a sheet"); @@ -227,7 +227,7 @@ public class ScTableSheetObj extends TestCase { throw new StatusException("Exception occurred while filling cells", e); } - oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, oSheet); + oObj = UnoRuntime.queryInterface(XInterface.class, oSheet); log.println("creating a new environment for object"); @@ -262,7 +262,7 @@ public class ScTableSheetObj extends TestCase { XSpreadsheet sSheet = null; try { - sSheet = (XSpreadsheet) UnoRuntime.queryInterface( + sSheet = UnoRuntime.queryInterface( XSpreadsheet.class, xSpreadsheets.getByName("Scenario")); } catch (com.sun.star.container.NoSuchElementException e) { @@ -277,7 +277,7 @@ public class ScTableSheetObj extends TestCase { " 'XArrayFormulaRange'"); tEnv.addObjRelation("noArray", "ScTableSheetObj"); - XPropertySet PropSet = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet PropSet = UnoRuntime.queryInterface( XPropertySet.class, oObj); tEnv.addObjRelation("PropSet", PropSet); tEnv.addObjRelation("SHEET", oSheet); @@ -316,7 +316,7 @@ public class ScTableSheetObj extends TestCase { oSheet.getCellByPosition(15, 16) }); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - e.printStackTrace((PrintWriter) log); + e.printStackTrace(log); log.println( "Cannot make required object relation 'XSearchable.MAKEENTRYINCELL'."); } diff --git a/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java index fd2e151c0a73..61b7b72d6b89 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java @@ -112,10 +112,9 @@ public class ScTableSheetsObj extends TestCase { SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF()); log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); - XInterface oObj = (XInterface) - UnoRuntime.queryInterface(XInterface.class, xSpreadsheets); + XInterface oObj = UnoRuntime.queryInterface(XInterface.class, xSpreadsheets); log.println("creating a new environment for object"); TestEnvironment tEnv = new TestEnvironment(oObj); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java b/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java index 8c0c1d6ca6ce..ac071b3c2dd2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java @@ -96,7 +96,7 @@ public class ScTableValidationObj extends TestCase { XInterface oObj = null; log.println("getting sheets"); - XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); + XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; @@ -129,8 +129,7 @@ public class ScTableValidationObj extends TestCase { XPropertySet Props = null; try { - Props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oSheet); + Props = UnoRuntime.queryInterface(XPropertySet.class, oSheet); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),Props.getPropertyValue("Validation")); } catch (com.sun.star.lang.WrappedTargetException e){ diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java index f2a37f9fb723..4206440fcaf5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java @@ -77,7 +77,7 @@ public class ScUniqueCellFormatsEnumeration extends TestCase { XIndexAccess.class, xSheetDoc.getSheets()); try { - oSheet = (XSpreadsheet) UnoRuntime.queryInterface( + oSheet = UnoRuntime.queryInterface( XSpreadsheet.class, xIA.getByIndex(0)); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); @@ -114,7 +114,7 @@ public class ScUniqueCellFormatsEnumeration extends TestCase { protected void changeColor(String RangeName, int r, int g, int b) { XCellRange xRange = oSheet.getCellRangeByName(RangeName); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, xRange); Color c = new Color(r, g, b); int c2int = 16777216 + c.hashCode(); diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java index 9d7b706668e9..03e46718d24e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java @@ -76,7 +76,7 @@ public class ScUniqueCellFormatsObj extends TestCase { XIndexAccess.class, xSheetDoc.getSheets()); try { - oSheet = (XSpreadsheet) UnoRuntime.queryInterface( + oSheet = UnoRuntime.queryInterface( XSpreadsheet.class, xIA.getByIndex(0)); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); @@ -108,7 +108,7 @@ public class ScUniqueCellFormatsObj extends TestCase { protected void changeColor(String RangeName, int r, int g, int b) { XCellRange xRange = oSheet.getCellRangeByName(RangeName); - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, xRange); Color c = new Color(r, g, b); int c2int = 16777216 + c.hashCode(); diff --git a/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java index bdda48d7ad76..b96da0233a79 100644 --- a/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java @@ -158,7 +158,7 @@ public class ScViewPaneObj extends TestCase { try { log.println( "getting Drawpages" ); XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); - XDrawPages oDP = (XDrawPages) oDPS.getDrawPages(); + XDrawPages oDP = oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); oDrawPage = (XDrawPage) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java index 7793b5d07673..2fde6b2a544d 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java @@ -135,7 +135,7 @@ public class XMLMetaExporter extends TestCase { // Obtaining and changing property values XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xSheetDoc) ; - XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; docInfo.setPropertyValue("Title", "TestDocument"); diff --git a/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java index 30875b90af74..f5df59c92d24 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java @@ -161,7 +161,7 @@ public class XMLMetaImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xSheetDoc) ; - final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + final XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; final PrintWriter logF = log ; diff --git a/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java index a8fba99670ec..599d0f5ec653 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java @@ -128,8 +128,7 @@ public class XMLSettingsExporter extends TestCase { //set some settings XModel xSheetModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xSheetModel.getCurrentController(); - XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); xPropSet.setPropertyValue("ShowGrid", "false"); util.CalcTools.fillCalcSheetWithContent(xSheetDoc, 0, 3, 3, 50, 50); diff --git a/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java index 72218cfb741e..5fadc74e608c 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java @@ -135,8 +135,7 @@ public class XMLSettingsImporter extends TestCase { XModel xSheetModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xSheetModel.getCurrentController(); - xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log) ; throw new StatusException("Can't create component.", e) ; diff --git a/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java index ff310e27d168..ea1c7773a4ad 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java @@ -141,8 +141,7 @@ public class XMLStylesExporter extends TestCase { StyleFamilies.getByName(styleFamiliesNames[0])); Object SC = SOF.createInstance( xSheetDoc, "com.sun.star.style.CellStyle"); - XStyle StyleCell = (XStyle) - UnoRuntime.queryInterface(XStyle.class,SC); + XStyle StyleCell = UnoRuntime.queryInterface(XStyle.class,SC); StyleFamilyName.insertByName(newName, StyleCell); log.println("fill sheet 1 with content..."); diff --git a/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java index a83e770ac51b..0d6ab7d9ae7b 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java @@ -174,7 +174,7 @@ public class XMLStylesImporter extends TestCase { (XStyleFamiliesSupplier.class, xSheetDoc); XNameAccess oStyleFamilies = sup.getStyleFamilies(); Object family = oStyleFamilies.getByName("CellStyles") ; - styles = (XNameAccess) UnoRuntime.queryInterface + styles = UnoRuntime.queryInterface (XNameAccess.class, family) ; log.println("Styles before:") ; String[] names = styles.getElementNames() ; diff --git a/qadevOOo/tests/java/mod/_sch/AccFloor.java b/qadevOOo/tests/java/mod/_sch/AccFloor.java index ea2c3138b9d1..7e11514800ae 100644 --- a/qadevOOo/tests/java/mod/_sch/AccFloor.java +++ b/qadevOOo/tests/java/mod/_sch/AccFloor.java @@ -59,8 +59,7 @@ public class AccFloor extends TestCase { } log.println("Change Diagram to 3D"); - XPropertySet ChartProps = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, xChartDoc.getDiagram() ); + XPropertySet ChartProps = UnoRuntime.queryInterface( XPropertySet.class, xChartDoc.getDiagram() ); try { ChartProps.setPropertyValue("Dim3D", new Boolean(true)); } catch(com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java b/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java index e895caf34aa0..830d5ebf6196 100644 --- a/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java +++ b/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java @@ -53,8 +53,7 @@ public class AccStatisticsObject extends TestCase { log.println( "creating a chartdocument" ); xChartDoc = SOF.createChartDoc(null); log.println("Display MeanValue"); - XPropertySet diagProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xChartDoc.getDiagram()); + XPropertySet diagProps = UnoRuntime.queryInterface(XPropertySet.class, xChartDoc.getDiagram()); diagProps.setPropertyValue("MeanValue",new Boolean(true)); } catch (com.sun.star.uno.Exception e) { // Some exception occures.FAILED diff --git a/qadevOOo/tests/java/mod/_sch/AccWall.java b/qadevOOo/tests/java/mod/_sch/AccWall.java index e33ffdfb10e4..566646e26a4e 100644 --- a/qadevOOo/tests/java/mod/_sch/AccWall.java +++ b/qadevOOo/tests/java/mod/_sch/AccWall.java @@ -59,8 +59,7 @@ public class AccWall extends TestCase { } log.println("Change Diagram to 3D"); - XPropertySet ChartProps = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, xChartDoc.getDiagram() ); + XPropertySet ChartProps = UnoRuntime.queryInterface( XPropertySet.class, xChartDoc.getDiagram() ); try { ChartProps.setPropertyValue("Dim3D", new Boolean(true)); } catch(com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java b/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java index 55e831e12da2..c4ce2deda85b 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java +++ b/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java @@ -101,12 +101,12 @@ public class ChXChartAxis extends TestCase { // create testobject here // get the Diagram log.println( "getting Diagram" ); - oDiagram = (XDiagram) xChartDoc.getDiagram(); + oDiagram = xChartDoc.getDiagram(); // get the Axis log.println( "getting ChartAxis" ); XAxisYSupplier oAxisSup = UnoRuntime.queryInterface(XAxisYSupplier.class,oDiagram); - oObj = (XPropertySet) oAxisSup.getYAxis(); + oObj = oAxisSup.getYAxis(); log.println( "creating a new environment for chartdocument object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartData.java b/qadevOOo/tests/java/mod/_sch/ChXChartData.java index 2795f88b4043..7016bde6e293 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXChartData.java +++ b/qadevOOo/tests/java/mod/_sch/ChXChartData.java @@ -81,7 +81,7 @@ public class ChXChartData extends TestCase { // get the Data log.println( "getting Data" ); - XChartData oObj = (XChartData) xChartDoc.getData(); + XChartData oObj = xChartDoc.getData(); log.println( "creating a new environment for chartdocument object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java b/qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java index 5d65c922261f..ab5c292000a9 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java +++ b/qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java @@ -85,7 +85,7 @@ public class ChXChartDataArray extends TestCase { // get the Data log.println( "getting Data" ); - XChartData oObj = (XChartData) xChartDoc.getData(); + XChartData oObj = xChartDoc.getData(); log.println( "creating a new environment for chartdocument object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java b/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java index e492aafe68df..629d61dbf304 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java +++ b/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java @@ -127,7 +127,7 @@ public class ChXChartDocument extends TestCase { // get the chartdocument log.println("getting ChartDocument"); - XInterface oObj = (XChartDocument) xChartDoc; + XInterface oObj = xChartDoc; XController cont1 = xChartDoc.getCurrentController(); XController cont2 = doc2.getCurrentController(); diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartView.java b/qadevOOo/tests/java/mod/_sch/ChXChartView.java index 7938637108ea..b94a3431aac4 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXChartView.java +++ b/qadevOOo/tests/java/mod/_sch/ChXChartView.java @@ -102,7 +102,7 @@ public class ChXChartView extends TestCase { // get the ChartView log.println( "getting ChartView" ); oModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); - oObj = (XController)oModel.getCurrentController(); + oObj = oModel.getCurrentController(); log.println( "creating a new environment for chartdocument object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); @@ -111,7 +111,7 @@ public class ChXChartView extends TestCase { {xChartDoc.getArea(), xChartDoc.getDiagram(), xChartDoc.getTitle(), xChartDoc.getLegend()} ); - tEnv.addObjRelation("Comparer", new Comparator() { + tEnv.addObjRelation("Comparer", new Comparator<Object>() { public int compare(Object o1, Object o2) { XShapeDescriptor descr1 = UnoRuntime.queryInterface(XShapeDescriptor.class, o1); XShapeDescriptor descr2 = UnoRuntime.queryInterface(XShapeDescriptor.class, o2); diff --git a/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java b/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java index ff65263bf7b4..6aacd1434f59 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java +++ b/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java @@ -125,8 +125,8 @@ public class ChXDataPoint extends TestCase { // get the DataRowPoint_Point try { log.println( "getting ChXDataRowPoint_Point" ); - oDiagram = (XDiagram) xChartDoc.getDiagram(); - oObj = (XPropertySet) oDiagram.getDataPointProperties(1,1); + oDiagram = xChartDoc.getDiagram(); + oObj = oDiagram.getDataPointProperties(1,1); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { // Some exception occures.FAILED e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sch/ChXDataRow.java b/qadevOOo/tests/java/mod/_sch/ChXDataRow.java index 325328b07493..e5b1c2e1a89f 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXDataRow.java +++ b/qadevOOo/tests/java/mod/_sch/ChXDataRow.java @@ -129,8 +129,8 @@ public class ChXDataRow extends TestCase { // get the ChXDataRowPoint_Row try { log.println( "getting ChXDataRowPoint_Row" ); - oDiagram = (XDiagram) xChartDoc.getDiagram(); - oObj = (XPropertySet) oDiagram.getDataRowProperties(1); + oDiagram = xChartDoc.getDiagram(); + oObj = oDiagram.getDataRowProperties(1); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { // Some exception occures.FAILED e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sch/ChXDiagram.java b/qadevOOo/tests/java/mod/_sch/ChXDiagram.java index 7df995ee5bc3..e2811fad2e75 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXDiagram.java +++ b/qadevOOo/tests/java/mod/_sch/ChXDiagram.java @@ -298,8 +298,7 @@ public class ChXDiagram extends TestCase { // insert a chart Rectangle oRect = new Rectangle(500, 3000, 25000, 11000); - XCellRange oRange = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); @@ -320,9 +319,8 @@ public class ChXDiagram extends TestCase { XTableChart oChart = null; try { oChart = (XTableChart) AnyConverter.toObject( - new Type(XTableChart.class),((XNameAccess) - UnoRuntime.queryInterface( - XNameAccess.class, oCharts)).getByName("ChXDiagram")); + new Type(XTableChart.class),UnoRuntime.queryInterface( + XNameAccess.class, oCharts).getByName("ChXDiagram")); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); throw new StatusException("Couldn't get TableChart", e); @@ -337,7 +335,7 @@ public class ChXDiagram extends TestCase { XEmbeddedObjectSupplier oEOS = UnoRuntime.queryInterface(XEmbeddedObjectSupplier.class, oChart); XInterface oInt = oEOS.getEmbeddedObject(); xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,oInt); - oObj = (XDiagram) xChartDoc.getDiagram(); + oObj = xChartDoc.getDiagram(); log.println( "creating a new environment for chartdocument object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sch/ChartArea.java b/qadevOOo/tests/java/mod/_sch/ChartArea.java index 8609c5757547..659c397d85a1 100644 --- a/qadevOOo/tests/java/mod/_sch/ChartArea.java +++ b/qadevOOo/tests/java/mod/_sch/ChartArea.java @@ -100,7 +100,7 @@ public class ChartArea extends TestCase { // get the Area log.println( "getting Area" ); - XPropertySet oObj = (XPropertySet) xChartDoc.getArea(); + XPropertySet oObj = xChartDoc.getArea(); log.println( "creating a new environment for chartdocument object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sch/ChartGrid.java b/qadevOOo/tests/java/mod/_sch/ChartGrid.java index 97d2de65e797..4609a538d438 100644 --- a/qadevOOo/tests/java/mod/_sch/ChartGrid.java +++ b/qadevOOo/tests/java/mod/_sch/ChartGrid.java @@ -94,12 +94,12 @@ public class ChartGrid extends TestCase { // get the Diagram log.println( "getting Diagram" ); - oDiagram = (XDiagram) xChartDoc.getDiagram(); + oDiagram = xChartDoc.getDiagram(); // get the Grid log.println( "getting ChartGrid" ); XAxisXSupplier oAxisSup = UnoRuntime.queryInterface(XAxisXSupplier.class,oDiagram); - oObj = (XPropertySet) oAxisSup.getXMainGrid(); + oObj = oAxisSup.getXMainGrid(); log.println( "creating a new environment for chartdocument object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sch/ChartLegend.java b/qadevOOo/tests/java/mod/_sch/ChartLegend.java index f54ae9ee14a2..67841c7fd28d 100644 --- a/qadevOOo/tests/java/mod/_sch/ChartLegend.java +++ b/qadevOOo/tests/java/mod/_sch/ChartLegend.java @@ -118,7 +118,7 @@ public class ChartLegend extends TestCase { // get the Legend log.println( "getting Legend" ); - oObj = (XShape) xChartDoc.getLegend(); + oObj = xChartDoc.getLegend(); log.println( "creating a new environment for chartdocument object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sch/ChartTitle.java b/qadevOOo/tests/java/mod/_sch/ChartTitle.java index 64a64304b98e..cdfbb7cae6ca 100644 --- a/qadevOOo/tests/java/mod/_sch/ChartTitle.java +++ b/qadevOOo/tests/java/mod/_sch/ChartTitle.java @@ -99,7 +99,7 @@ public class ChartTitle extends TestCase { // get the Title log.println( "getting Title" ); - XShape oObj = (XShape) xChartDoc.getTitle(); + XShape oObj = xChartDoc.getTitle(); log.println( "creating a new environment for chartdocument object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java index eee7fd14cc05..166d3b2ce141 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java @@ -222,7 +222,7 @@ public class DrawController_DrawView extends TestCase { tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); - tEnv.addObjRelation("Comparer", new Comparator() { + tEnv.addObjRelation("Comparer", new Comparator<Object>() { public int compare(Object o1, Object o2) { XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java index fbe9eea1f4f1..f7d28e007b4b 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java @@ -251,7 +251,7 @@ public class DrawController_HandoutView extends TestCase { tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); - tEnv.addObjRelation("Comparer", new Comparator() { + tEnv.addObjRelation("Comparer", new Comparator<Object>() { public int compare(Object o1, Object o2) { XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java index 70a1c5aa4df2..f82f7f32c54b 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java @@ -248,7 +248,7 @@ public class DrawController_NotesView extends TestCase { tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); - tEnv.addObjRelation("Comparer", new Comparator() { + tEnv.addObjRelation("Comparer", new Comparator<Object>() { public int compare(Object o1, Object o2) { XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java index 7595155fafa4..8bdf5b0b12dd 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java @@ -248,7 +248,7 @@ public class DrawController_OutlineView extends TestCase { tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); - tEnv.addObjRelation("Comparer", new Comparator() { + tEnv.addObjRelation("Comparer", new Comparator<Object>() { public int compare(Object o1, Object o2) { XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java index c2c2f5f2c5c2..2a6590f1530b 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java @@ -248,7 +248,7 @@ public class DrawController_PresentationView extends TestCase { tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); - tEnv.addObjRelation("Comparer", new Comparator() { + tEnv.addObjRelation("Comparer", new Comparator<Object>() { public int compare(Object o1, Object o2) { XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); diff --git a/qadevOOo/tests/java/mod/_sd/SdDrawPage.java b/qadevOOo/tests/java/mod/_sd/SdDrawPage.java index 780c56ce4a17..8b362da646a8 100644 --- a/qadevOOo/tests/java/mod/_sd/SdDrawPage.java +++ b/qadevOOo/tests/java/mod/_sd/SdDrawPage.java @@ -189,7 +189,7 @@ public class SdDrawPage extends TestCase { XControlShape aShape = FormTools.createControlShape( xDrawDoc,3000,4500,15000,10000,"CommandButton"); - oShapes.add((XShape) aShape); + oShapes.add(aShape); ShapeDsc sDsc = new ShapeDsc(5000, 3500, 7500, 10000, "Rectangle"); log.println( "adding Shape as mod relation to environment" ); diff --git a/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java b/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java index b148ccbb5d5d..32ea7f77c91b 100644 --- a/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java +++ b/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java @@ -103,7 +103,7 @@ public class SdDrawPagesAccess extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpages" ); XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); - XDrawPages oDP = (XDrawPages) oDPS.getDrawPages(); + XDrawPages oDP = oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); XInterface oObj = oDP; diff --git a/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java b/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java index 7020cff676d9..852dba72537f 100644 --- a/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java +++ b/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java @@ -110,8 +110,7 @@ public class SdPageLinkTargets extends TestCase { SOF.createShape(xDrawDoc, 15000, 13500, 5000, 5000, "OLE2"); oShapes.add(oShape); - XPropertySet shape_props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); + XPropertySet shape_props = UnoRuntime.queryInterface(XPropertySet.class,oShape); log.println("Inserting a Chart"); diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java b/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java index 881a2c17526d..aaa0040c0bcf 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java @@ -248,7 +248,7 @@ public class SdUnoDrawView extends TestCase { tEnv.addObjRelation("XComponent.DisposeThis", xDrawDoc); - tEnv.addObjRelation("Comparer", new Comparator() { + tEnv.addObjRelation("Comparer", new Comparator<Object>() { public int compare(Object o1, Object o2) { XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); @@ -257,10 +257,7 @@ public class SdUnoDrawView extends TestCase { return 0; } return 1; - } - public boolean equals(Object obj) { - return compare(this, obj) == 0; - } }); + }}); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java index 80e1afefd65f..db51a16fd3fa 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java @@ -216,7 +216,7 @@ public class SdUnoPresView extends TestCase { tEnv.addObjRelation("Selections", new Object[] { oDrawPage, secondDrawPage}); - tEnv.addObjRelation("Comparer", new Comparator() { + tEnv.addObjRelation("Comparer", new Comparator<Object>() { public int compare(Object o1, Object o2) { XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); @@ -225,10 +225,7 @@ public class SdUnoPresView extends TestCase { return 0; } return 1; - } - public boolean equals(Object obj) { - return compare(this, obj) == 0; - } }); + }}); tEnv.addObjRelation("FirstPage", oDrawPage); tEnv.addObjRelation("SecondPage", secondDrawPage); diff --git a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java index 2beb29244e9d..679fd3d6f94b 100644 --- a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java +++ b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java @@ -126,8 +126,7 @@ public class SdXCustomPresentation extends TestCase { XCustomPresentationSupplier.class, xImpressDoc); XInterface oObj = oPS.getCustomPresentations(); - XSingleServiceFactory oSingleMSF = (XSingleServiceFactory) - UnoRuntime.queryInterface(XSingleServiceFactory.class, oObj); + XSingleServiceFactory oSingleMSF = UnoRuntime.queryInterface(XSingleServiceFactory.class, oObj); XInterface oInstance = null; try { @@ -137,8 +136,7 @@ public class SdXCustomPresentation extends TestCase { throw new StatusException("Couldn't create instance", e); } - XNameContainer aContainer = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oObj); + XNameContainer aContainer = UnoRuntime.queryInterface(XNameContainer.class, oObj); try { aContainer.insertByName("FirstPresentation", oInstance); diff --git a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java index b0e10ade3ad5..e3a209ed1b07 100644 --- a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java +++ b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java @@ -125,8 +125,7 @@ public class SdXCustomPresentationAccess extends TestCase { XInterface oObj = oPS.getCustomPresentations(); - XSingleServiceFactory oSingleMSF = (XSingleServiceFactory) - UnoRuntime.queryInterface(XSingleServiceFactory.class, oObj); + XSingleServiceFactory oSingleMSF = UnoRuntime.queryInterface(XSingleServiceFactory.class, oObj); XInterface oInstance = null; XInterface oSecondInstance = null; @@ -138,8 +137,7 @@ public class SdXCustomPresentationAccess extends TestCase { throw new StatusException("Couldn't create instance", e); } - XNameContainer aContainer = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oObj); + XNameContainer aContainer = UnoRuntime.queryInterface(XNameContainer.class, oObj); if (aContainer.hasByName("FirstPresentation")) { try { diff --git a/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java b/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java index 1fe938760f40..368bbafe93fc 100644 --- a/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java +++ b/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java @@ -143,7 +143,7 @@ public class SdXImpressDocument extends TestCase { "Rectangle"); - XPropertySet xShapeProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, aShape); + XPropertySet xShapeProps = UnoRuntime.queryInterface(XPropertySet.class, aShape); try { xShapeProps.setPropertyValue("FillStyle", com.sun.star.drawing.FillStyle.SOLID); diff --git a/qadevOOo/tests/java/mod/_sd/SdXPresentation.java b/qadevOOo/tests/java/mod/_sd/SdXPresentation.java index a8f754690a59..a9eadb8260b4 100644 --- a/qadevOOo/tests/java/mod/_sd/SdXPresentation.java +++ b/qadevOOo/tests/java/mod/_sd/SdXPresentation.java @@ -116,8 +116,7 @@ public class SdXPresentation extends TestCase { XInterface oInstance = null; XInterface oInstance2 = null; - XSingleServiceFactory oSingleMSF = (XSingleServiceFactory) - UnoRuntime.queryInterface(XSingleServiceFactory.class, xCP); + XSingleServiceFactory oSingleMSF = UnoRuntime.queryInterface(XSingleServiceFactory.class, xCP); try{ oInstance = (XInterface) oSingleMSF.createInstance(); diff --git a/qadevOOo/tests/java/mod/_sd/SdXShape.java b/qadevOOo/tests/java/mod/_sd/SdXShape.java index 41c3b55b9ef7..7ca5704ce3a3 100644 --- a/qadevOOo/tests/java/mod/_sd/SdXShape.java +++ b/qadevOOo/tests/java/mod/_sd/SdXShape.java @@ -156,14 +156,13 @@ public class SdXShape extends TestCase { XShape oShape = SOF.createShape (xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"); oShapes.add((XShape) oObj); - oShapes.add((XShape) oShape); + oShapes.add(oShape); log.println( "creating a new environment for XShape object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); log.println( "adding two style as ObjRelation for ShapeDescriptor" ); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class, oObj); XStyle aStyle = null; try { aStyle = (XStyle) AnyConverter.toObject( @@ -184,8 +183,7 @@ public class SdXShape extends TestCase { } tEnv.addObjRelation("Style1", aStyle); - oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oShape); + oShapeProps = UnoRuntime.queryInterface(XPropertySet.class, oShape); try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); diff --git a/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java b/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java index 4b2645799f2f..c3684d16f10d 100644 --- a/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java +++ b/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java @@ -85,7 +85,7 @@ public class SmEditAccessible extends TestCase { // setting a formula in document final String expFormula = "sum hat a"; - final XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface + final XPropertySet xPS = UnoRuntime.queryInterface (XPropertySet.class, xMathDoc); try { xPS.setPropertyValue("Formula", expFormula); diff --git a/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java index 0b76f49b22f2..4a54b860c7c3 100644 --- a/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java +++ b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java @@ -87,7 +87,7 @@ public class SmGraphicAccessible extends TestCase { // setting a formula in document final String expFormula = "sum a cdot b"; - final XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface + final XPropertySet xPS = UnoRuntime.queryInterface (XPropertySet.class, xMathDoc); try { xPS.setPropertyValue("Formula", expFormula); diff --git a/qadevOOo/tests/java/mod/_sm/XMLExporter.java b/qadevOOo/tests/java/mod/_sm/XMLExporter.java index 19258ba75eb0..893610c6049e 100644 --- a/qadevOOo/tests/java/mod/_sm/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_sm/XMLExporter.java @@ -125,7 +125,7 @@ public class XMLExporter extends TestCase { xEx.setSourceDocument(xMathDoc); // setting a formula in document - XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface + XPropertySet xPS = UnoRuntime.queryInterface (XPropertySet.class, xMathDoc) ; xPS.setPropertyValue("Formula", expFormula) ; } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_sm/XMLImporter.java b/qadevOOo/tests/java/mod/_sm/XMLImporter.java index b3d589cfa95a..6a5e38a3a1da 100644 --- a/qadevOOo/tests/java/mod/_sm/XMLImporter.java +++ b/qadevOOo/tests/java/mod/_sm/XMLImporter.java @@ -136,7 +136,7 @@ public class XMLImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; final PrintWriter logF = log ; - final XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface + final XPropertySet xPS = UnoRuntime.queryInterface (XPropertySet.class, xMathDoc) ; tEnv.addObjRelation("XDocumentHandler.ImportChecker", diff --git a/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java index ea7b67127b03..bde9b09712cb 100644 --- a/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java @@ -157,9 +157,8 @@ public class XMLMetaImporter extends TestCase { public boolean checkImport() { try { XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo() ; - XPropertySet xDocInfoProp = (XPropertySet) - UnoRuntime.queryInterface - (XPropertySet.class, xDocInfo) ; + XPropertySet xDocInfoProp = UnoRuntime.queryInterface + (XPropertySet.class, xDocInfo) ; boolean result = false ; for (short i = 0; i < xDocInfo.getUserFieldCount(); i++) { String gName = xDocInfo.getUserFieldName(i) ; diff --git a/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java index 4f96126fe95b..5106138ee6ef 100644 --- a/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java @@ -126,7 +126,7 @@ public class XMLSettingsExporter extends TestCase { xEx.setSourceDocument(xMathDoc); // setting a formula in document - XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface + XPropertySet xPS = UnoRuntime.queryInterface (XPropertySet.class, xMathDoc) ; xPS.setPropertyValue("TopMargin", new Short(expMargin)) ; diff --git a/qadevOOo/tests/java/mod/_sm/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_sm/XMLSettingsImporter.java index eabf2d4bbafd..9860a8609fab 100644 --- a/qadevOOo/tests/java/mod/_sm/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_sm/XMLSettingsImporter.java @@ -146,7 +146,7 @@ public class XMLSettingsImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; final PrintWriter logF = log ; - final XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface + final XPropertySet xPS = UnoRuntime.queryInterface (XPropertySet.class, xMathDoc) ; tEnv.addObjRelation("XDocumentHandler.ImportChecker", diff --git a/qadevOOo/tests/java/mod/_smgr/OServiceManager.java b/qadevOOo/tests/java/mod/_smgr/OServiceManager.java index c855144a225d..18d649f7b33c 100644 --- a/qadevOOo/tests/java/mod/_smgr/OServiceManager.java +++ b/qadevOOo/tests/java/mod/_smgr/OServiceManager.java @@ -117,9 +117,9 @@ public class OServiceManager extends TestCase { } try { - XSet set = (XSet) UnoRuntime.queryInterface + XSet set = UnoRuntime.queryInterface (XSet.class, oInterface) ; - XSet set1 = (XSet) UnoRuntime.queryInterface + XSet set1 = UnoRuntime.queryInterface (XSet.class, srvMan) ; XEnumeration oEnum = set1.createEnumeration(); Object srv = oEnum.nextElement(); @@ -128,7 +128,7 @@ public class OServiceManager extends TestCase { newElement = oEnum.nextElement(); - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet xProp = UnoRuntime.queryInterface( XPropertySet.class, oInterface); if (xProp != null) { xContext = (XComponentContext) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_stm/DataInputStream.java b/qadevOOo/tests/java/mod/_stm/DataInputStream.java index a16475076e98..9acc80713db1 100644 --- a/qadevOOo/tests/java/mod/_stm/DataInputStream.java +++ b/qadevOOo/tests/java/mod/_stm/DataInputStream.java @@ -107,8 +107,7 @@ public class DataInputStream extends TestCase { throw new StatusException("Couldn't create instance", e); } - XInputStream xPipeInput = (XInputStream) - UnoRuntime.queryInterface(XInputStream.class, oPipe); + XInputStream xPipeInput = UnoRuntime.queryInterface(XInputStream.class, oPipe); XOutputStream xPipeOutput = UnoRuntime.queryInterface(XOutputStream.class, oPipe); XInterface oDataOutput = null; diff --git a/qadevOOo/tests/java/mod/_stm/DataOutputStream.java b/qadevOOo/tests/java/mod/_stm/DataOutputStream.java index 225aaa13a69a..d939efba379e 100644 --- a/qadevOOo/tests/java/mod/_stm/DataOutputStream.java +++ b/qadevOOo/tests/java/mod/_stm/DataOutputStream.java @@ -125,8 +125,7 @@ public class DataOutputStream extends TestCase { //add relation for io.XOutputStream final XMultiServiceFactory msf = xMSF; - final XInputStream xPipeInput = (XInputStream) - UnoRuntime.queryInterface(XInputStream.class, oPipe); + final XInputStream xPipeInput = UnoRuntime.queryInterface(XInputStream.class, oPipe); tEnv.addObjRelation("XOutputStream.StreamChecker", new ifc.io._XOutputStream.StreamChecker() { XInputStream xInStream = null; @@ -150,7 +149,7 @@ public class DataOutputStream extends TestCase { try { Object oInStream = msf.createInstance( "com.sun.star.io.DataInputStream"); - xInStream = (XInputStream) UnoRuntime.queryInterface + xInStream = UnoRuntime.queryInterface (XInputStream.class, oInStream); } catch(com.sun.star.uno.Exception e) { return null; diff --git a/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java b/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java index 85b00ddcdafc..2afa3f1a97e7 100644 --- a/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java +++ b/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java @@ -104,8 +104,7 @@ public class MarkableInputStream extends TestCase { XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream); XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class, aPipe); - XInputStream PipeIn = (XInputStream) - UnoRuntime.queryInterface(XInputStream.class, aPipe); + XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class, aPipe); xdSmo.setOutputStream(PipeOut); diff --git a/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java b/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java index 1ee7ddbc1b6b..8203db02c8ba 100644 --- a/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java +++ b/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java @@ -115,8 +115,7 @@ public class MarkableOutputStream extends TestCase { XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream); final XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class,aPipe); - final XInputStream PipeIn = (XInputStream) - UnoRuntime.queryInterface(XInputStream.class,aPipe); + final XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class,aPipe); xdSmo.setOutputStream(PipeOut); @@ -173,7 +172,7 @@ public class MarkableOutputStream extends TestCase { try { Object oInStream = msf.createInstance( "com.sun.star.io.MarkableInputStream"); - xInStream = (XInputStream) UnoRuntime.queryInterface + xInStream = UnoRuntime.queryInterface (XInputStream.class, oInStream); } catch(com.sun.star.uno.Exception e) { return null; diff --git a/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java b/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java index 1ca8772b3a05..220d37ad9c54 100644 --- a/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java +++ b/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java @@ -191,7 +191,7 @@ public class ObjectInputStream extends TestCase { ("com.sun.star.io.MarkableInputStream"); mostream = xMSF.createInstance ("com.sun.star.io.MarkableOutputStream"); - xConnect = (XInterface)xMSF.createInstance + xConnect = xMSF.createInstance ("com.sun.star.io.DataInputStream") ; } catch( com.sun.star.uno.Exception e ) { @@ -208,8 +208,7 @@ public class ObjectInputStream extends TestCase { XOutputStream moStream = UnoRuntime.queryInterface(XOutputStream.class, mostream); XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class, aPipe); - XInputStream PipeIn = (XInputStream) - UnoRuntime.queryInterface(XInputStream.class, aPipe); + XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class, aPipe); xdSo.setOutputStream(moStream); xdSmo.setOutputStream(PipeOut); @@ -219,8 +218,7 @@ public class ObjectInputStream extends TestCase { oStream = UnoRuntime.queryInterface(XObjectOutputStream.class, ostream); XActiveDataSink xmSi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream); - XInputStream xmIstream = (XInputStream) - UnoRuntime.queryInterface(XInputStream.class, mistream); + XInputStream xmIstream = UnoRuntime.queryInterface(XInputStream.class, mistream); XActiveDataSink xdSi = UnoRuntime.queryInterface (XActiveDataSink.class, istream); @@ -232,8 +230,7 @@ public class ObjectInputStream extends TestCase { try { Object oPersObj = xMSF.createInstance ("com.sun.star.cmp.PersistObject"); - xPersObj = (XPersistObject) - UnoRuntime.queryInterface(XPersistObject.class, oPersObj); + xPersObj = UnoRuntime.queryInterface(XPersistObject.class, oPersObj); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); throw new StatusException("Can't write persist object.", e); diff --git a/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java b/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java index ca180e3868c4..675de8cdd949 100644 --- a/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java +++ b/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java @@ -201,12 +201,10 @@ public class ObjectOutputStream extends TestCase { XActiveDataSink markIn = UnoRuntime.queryInterface(XActiveDataSink.class, minstream); XActiveDataSink inStream = UnoRuntime.queryInterface(XActiveDataSink.class, istream); - XInputStream markInStream = (XInputStream) - UnoRuntime.queryInterface(XInputStream.class, minstream); + XInputStream markInStream = UnoRuntime.queryInterface(XInputStream.class, minstream); final XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class,aPipe); - final XInputStream PipeIn = (XInputStream) - UnoRuntime.queryInterface(XInputStream.class,aPipe); + final XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class,aPipe); markIn.setInputStream(PipeIn); inStream.setInputStream(markInStream); @@ -221,8 +219,7 @@ public class ObjectOutputStream extends TestCase { try { Object oPersObj = xMSF.createInstance ("com.sun.star.cmp.PersistObject"); - xPersObj = (XPersistObject) - UnoRuntime.queryInterface(XPersistObject.class, oPersObj); + xPersObj = UnoRuntime.queryInterface(XPersistObject.class, oPersObj); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); throw new StatusException("Can't write persist object.", e) ; @@ -280,7 +277,7 @@ public class ObjectOutputStream extends TestCase { try { Object oInStream = msf.createInstance( "com.sun.star.io.ObjectInputStream"); - xInStream = (XInputStream) UnoRuntime.queryInterface + xInStream = UnoRuntime.queryInterface (XInputStream.class, oInStream); } catch(com.sun.star.uno.Exception e) { return null; diff --git a/qadevOOo/tests/java/mod/_stm/Pipe.java b/qadevOOo/tests/java/mod/_stm/Pipe.java index 1c026d08b45f..e3c869aec22d 100644 --- a/qadevOOo/tests/java/mod/_stm/Pipe.java +++ b/qadevOOo/tests/java/mod/_stm/Pipe.java @@ -82,8 +82,7 @@ public class Pipe extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); //add relation for io.XOutputStream - final XInputStream iStream = (XInputStream) - UnoRuntime.queryInterface(XInputStream.class, oObj); + final XInputStream iStream = UnoRuntime.queryInterface(XInputStream.class, oObj); tEnv.addObjRelation("ByteData", byteData); tEnv.addObjRelation("StreamWriter", oObj); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java index 6c21e77c57f3..d2e7effb02e9 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java @@ -246,7 +246,7 @@ public class AccessibleIconChoiceCtrl extends TestCase { tEnv.addObjRelation("expectedStateNames", expectedStateNames); tEnv.addObjRelation("expectedStates", expectedStates); - final XAccessibleSelection selection = (XAccessibleSelection) UnoRuntime.queryInterface( + final XAccessibleSelection selection = UnoRuntime.queryInterface( XAccessibleSelection.class, oObj); diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java index 6ccca61e0087..429e061671ca 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java @@ -85,8 +85,7 @@ public class AccessibleOLEShape extends TestCase { DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape); - XPropertySet shape_props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); + XPropertySet shape_props = UnoRuntime.queryInterface(XPropertySet.class,oShape); log.println("Inserting a Chart"); diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java index c84cebb013a9..d0f723e97248 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java @@ -99,8 +99,7 @@ public class AccessiblePageShape extends TestCase { // UnoRuntime.queryInterface // (XAccessibleValue.class, at.SearchedContext) ; oPage = DrawTools.getDrawPage(xDrawDoc,0); - final XPropertySet PageProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oPage); + final XPropertySet PageProps = UnoRuntime.queryInterface(XPropertySet.class, oPage); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java index 43c9df187313..61fbd7cf0e0d 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java @@ -91,8 +91,7 @@ public class AccessiblePresentationGraphicShape extends TestCase { DrawTools.getShapes(DrawTools.getDrawPage(xDoc,0)).add(oShape); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oShape); try { oShapeProps.setPropertyValue( "GraphicURL",util.utils.getFullTestURL("space-metal.jpg")); diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java index 3e9773585f19..d4cbf2fcd8f2 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java @@ -91,8 +91,7 @@ public class AccessiblePresentationOLEShape extends TestCase { //DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oShape); try { oShapeProps.setPropertyValue("IsEmptyPresentationObject", new Boolean(false)); } catch (com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java index 42beb8b234a7..13fb69e5c269 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java @@ -92,8 +92,7 @@ public class AccessiblePresentationShape extends TestCase { DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape); - XPropertySet shapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oShape); + XPropertySet shapeProps = UnoRuntime.queryInterface(XPropertySet.class, oShape); try { shapeProps.setPropertyValue( diff --git a/qadevOOo/tests/java/mod/_svx/GraphicExporter.java b/qadevOOo/tests/java/mod/_svx/GraphicExporter.java index bbabd04c83e9..d4d430a8d637 100644 --- a/qadevOOo/tests/java/mod/_svx/GraphicExporter.java +++ b/qadevOOo/tests/java/mod/_svx/GraphicExporter.java @@ -141,7 +141,7 @@ public class GraphicExporter extends TestCase { "GraphicObject"); DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc, 0)).add(oShape); - XPropertySet oShapeProps = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet oShapeProps = UnoRuntime.queryInterface( XPropertySet.class, oShape); XComponent xComp = null; @@ -153,7 +153,7 @@ public class GraphicExporter extends TestCase { oShape); XExporter xEx = UnoRuntime.queryInterface( - XExporter.class, (XInterface) go); + XExporter.class, go); xEx.setSourceDocument(xComp); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java b/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java index ba2b953cbe23..55b93eeb2d1e 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java +++ b/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java @@ -155,7 +155,7 @@ public class SvxDrawPage extends TestCase { XDrawPagesSupplier oDPS = UnoRuntime.queryInterface( XDrawPagesSupplier.class, xDoc); - oDP = (XDrawPages) oDPS.getDrawPages(); + oDP = oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); oObj = (XDrawPage) AnyConverter.toObject(new Type(XDrawPage.class), diff --git a/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java b/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java index cc70da81de69..db6146c79d9c 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java +++ b/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java @@ -87,8 +87,7 @@ public class SvxGraphCtrlAccessibleContext extends TestCase{ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape); - XPropertySet shapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oShape); + XPropertySet shapeProps = UnoRuntime.queryInterface(XPropertySet.class, oShape); String url = util.utils.getFullTestURL("space-metal.jpg"); diff --git a/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java b/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java index 716bbf97290c..f1641f9c1d81 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java +++ b/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java @@ -168,8 +168,7 @@ public class SvxGraphicObject extends TestCase { oShape = SOF.createShape(xDrawDoc,3000,4500,15000,1000,"Ellipse"); DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oObj); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oObj); XStyle aStyle = null; try { aStyle = (XStyle) AnyConverter.toObject( @@ -180,8 +179,7 @@ public class SvxGraphicObject extends TestCase { } tEnv.addObjRelation("Style1",aStyle); - oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); + oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oShape); try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); @@ -193,8 +191,7 @@ public class SvxGraphicObject extends TestCase { // adding graphic as ObjRelation for GraphicObjectShape - oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oObj); + oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oObj); XBitmap aBitmap = null; try { oShapeProps.setPropertyValue( diff --git a/qadevOOo/tests/java/mod/_svx/SvxShape.java b/qadevOOo/tests/java/mod/_svx/SvxShape.java index 7a4eb70802da..c6f364aea036 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShape.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShape.java @@ -183,8 +183,7 @@ public class SvxShape extends TestCase { DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape); log.println( "adding two style as ObjRelation for ShapeDescriptor" ); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oObj); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oObj); XStyle aStyle = null; try { aStyle = (XStyle) AnyConverter.toObject( @@ -195,7 +194,7 @@ public class SvxShape extends TestCase { } tEnv.addObjRelation("Style1",aStyle); - oShapeProps = (XPropertySet) UnoRuntime.queryInterface + oShapeProps = UnoRuntime.queryInterface (XPropertySet.class,oShape); try { aStyle = (XStyle) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java b/qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java index b0a6db52e0d6..15a00912a0fc 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java @@ -170,7 +170,7 @@ public class SvxShapeCircle extends TestCase { SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ; oShape = SOF.createShape(xDrawDoc,5000,5000,3000,3000,"Ellipse"); - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface + XPropertySet props = UnoRuntime.queryInterface (XPropertySet.class, oShape) ; DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ; @@ -202,8 +202,7 @@ public class SvxShapeCircle extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); log.println( "adding two styles as ObjRelation for ShapeDescriptor" ); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oObj); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oObj); XStyle aStyle = null; try { @@ -215,8 +214,7 @@ public class SvxShapeCircle extends TestCase { } tEnv.addObjRelation("Style1",aStyle); - oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); + oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oShape); try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java b/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java index 4ce666cf608e..f1c080d9eda2 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java @@ -156,8 +156,7 @@ public class SvxShapeConnector extends TestCase { } log.println( "adding two style as ObjRelation for ShapeDescriptor" ); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oObj); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oObj); XStyle aStyle = null; try { aStyle = (XStyle) AnyConverter.toObject( @@ -165,8 +164,7 @@ public class SvxShapeConnector extends TestCase { } catch (Exception e) {} tEnv.addObjRelation("Style1",aStyle); - oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); + oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oShape); try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeControl.java b/qadevOOo/tests/java/mod/_svx/SvxShapeControl.java index bdff0c54982d..d7965e20ae43 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapeControl.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapeControl.java @@ -123,16 +123,14 @@ public class SvxShapeControl extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); log.println( "adding two styles as ObjRelation for ShapeDescriptor" ); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oObj); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oObj); XStyle aStyle = null; try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); } catch (Exception e) {} tEnv.addObjRelation("Style1",aStyle); - oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); + oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oShape); try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java b/qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java index 0e6ad96e57ac..57a56803f18b 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java @@ -132,16 +132,14 @@ public class SvxShapeDimensioning extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); log.println( "adding two styles as ObjRelation for ShapeDescriptor" ); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oObj); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oObj); XStyle aStyle = null; try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); } catch (Exception e) {} tEnv.addObjRelation("Style1",aStyle); - oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); + oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oShape); try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java b/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java index d0902ae695ad..5abdc141e705 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java @@ -134,15 +134,13 @@ public class SvxShapeGroup extends TestCase { oShapes.add(Shape2); log.println( "adding two style as ObjRelation for ShapeDescriptor" ); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,Shape1); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,Shape1); XStyle aStyle1 = null; try { aStyle1 = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); } catch (Exception e) {} - oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,Shape2); + oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,Shape2); XStyle aStyle2 = null; try { aStyle2 = (XStyle) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java index 7dd897328c8b..915976c6d995 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java @@ -207,8 +207,8 @@ public class SvxShapePolyPolygon extends TestCase { Point[][] polygon = new Point[][] {square1, square2}; - ((XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, - oShape)).setPropertyValue("PolyPolygon", polygon) ; + UnoRuntime.queryInterface(XPropertySet.class, + oShape).setPropertyValue("PolyPolygon", polygon) ; oObj = oShape ; @@ -226,16 +226,14 @@ public class SvxShapePolyPolygon extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); log.println( "adding two styles as ObjRelation for ShapeDescriptor" ); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oObj); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oObj); XStyle aStyle = null; try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); } catch (Exception e) {} tEnv.addObjRelation("Style1",aStyle); - oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); + oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oShape); try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java index abc012ae6477..3247af2e2fe4 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java @@ -220,7 +220,7 @@ public class SvxShapePolyPolygonBezier extends TestCase { oObj = oShape ; - XPropertySet shapeProps = (XPropertySet) UnoRuntime.queryInterface + XPropertySet shapeProps = UnoRuntime.queryInterface (XPropertySet.class, oObj); shapeProps.setPropertyValue("PolyPolygonBezier",coords); @@ -239,16 +239,14 @@ public class SvxShapePolyPolygonBezier extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); log.println( "adding two styles as ObjRelation for ShapeDescriptor" ); - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oObj); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oObj); XStyle aStyle = null; try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); } catch (Exception e) {} tEnv.addObjRelation("Style1",aStyle); - oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); + oShapeProps = UnoRuntime.queryInterface(XPropertySet.class,oShape); try { aStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oShapeProps.getPropertyValue("Style")); diff --git a/qadevOOo/tests/java/mod/_sw/CharacterStyle.java b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java index 8a72e83f4680..da479a855640 100644 --- a/qadevOOo/tests/java/mod/_sw/CharacterStyle.java +++ b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java @@ -104,10 +104,10 @@ public class CharacterStyle extends TestCase { xTextDoc); XNameAccess oSF = oSFS.getStyleFamilies(); XIndexAccess oSFsIA = UnoRuntime.queryInterface(XIndexAccess.class, oSF); - oSFNA = (XNameAccess) UnoRuntime.queryInterface( + oSFNA = UnoRuntime.queryInterface( XNameAccess.class,oSFsIA.getByIndex(0)); XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); - oStyle = (XStyle) UnoRuntime.queryInterface( + oStyle = UnoRuntime.queryInterface( XStyle.class,oSFIA.getByIndex(0)); } catch ( com.sun.star.lang.WrappedTargetException e ) { log.println("Error: exception occurred."); @@ -124,7 +124,7 @@ public class CharacterStyle extends TestCase { XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); XInterface oInt = (XInterface) oMSF.createInstance("com.sun.star.style.CharacterStyle"); - oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt); + oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt); } catch ( com.sun.star.uno.Exception e ) { log.println("Error: exception occurred."); e.printStackTrace(log); @@ -136,8 +136,7 @@ public class CharacterStyle extends TestCase { log.println("FAILED"); else log.println("OK"); - XNameContainer oSFNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oSFNA); + XNameContainer oSFNC = UnoRuntime.queryInterface(XNameContainer.class, oSFNA); try { if ( oSFNC.hasByName("My Style") ) @@ -159,8 +158,7 @@ public class CharacterStyle extends TestCase { XText oText = xTextDoc.getText(); XTextCursor oCursor = oText.createTextCursor(); - XPropertySet xProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oCursor); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, oCursor); try { xProp.setPropertyValue("CharStyleName", oMyStyle.getName()); @@ -182,8 +180,7 @@ public class CharacterStyle extends TestCase { tEnv = new TestEnvironment(oMyStyle); tEnv.addObjRelation("PoolStyle", oStyle); - XPropertySet xStyleProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); + XPropertySet xStyleProp = UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); short exclude = PropertyAttribute.MAYBEVOID + PropertyAttribute.READONLY; tEnv.addObjRelation("PropertyNames",utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude)); diff --git a/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java b/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java index e9bc64e1ab2b..e5d53a4eef6b 100644 --- a/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java +++ b/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java @@ -92,10 +92,10 @@ public class ConditionalParagraphStyle extends TestCase { XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); XNameAccess oSF = oSFS.getStyleFamilies(); - oSFNA = (XNameAccess) UnoRuntime.queryInterface( + oSFNA = UnoRuntime.queryInterface( XNameAccess.class,oSF.getByName("ParagraphStyles")); XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); - oStyle = (XStyle) UnoRuntime.queryInterface( + oStyle = UnoRuntime.queryInterface( XStyle.class,oSFIA.getByIndex(1)); } catch ( com.sun.star.lang.WrappedTargetException e ) { log.println("Error: exception occurred."); @@ -116,7 +116,7 @@ public class ConditionalParagraphStyle extends TestCase { XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); XInterface oInt = (XInterface) oMSF.createInstance("com.sun.star.style.ConditionalParagraphStyle"); - oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt); + oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt); } catch ( com.sun.star.uno.Exception e ) { log.println("Error: exception occurred."); e.printStackTrace(log); @@ -132,8 +132,7 @@ public class ConditionalParagraphStyle extends TestCase { log.println("OK"); } - XNameContainer oSFNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oSFNA); + XNameContainer oSFNC = UnoRuntime.queryInterface(XNameContainer.class, oSFNA); try { if ( oSFNC.hasByName("My Style") ) @@ -155,8 +154,7 @@ public class ConditionalParagraphStyle extends TestCase { XText oText = xTextDoc.getText(); XTextCursor oCursor = oText.createTextCursor(); - XPropertySet xProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oCursor); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, oCursor); try { xProp.setPropertyValue("ParaStyleName", oMyStyle.getName()); } catch ( com.sun.star.lang.WrappedTargetException e ) { @@ -177,8 +175,7 @@ public class ConditionalParagraphStyle extends TestCase { tEnv = new TestEnvironment(oMyStyle); tEnv.addObjRelation("PoolStyle", oStyle); - XPropertySet xStyleProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); + XPropertySet xStyleProp = UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); short exclude = PropertyAttribute.MAYBEVOID + PropertyAttribute.READONLY; String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude); tEnv.addObjRelation("PropertyNames", names); diff --git a/qadevOOo/tests/java/mod/_sw/PageStyle.java b/qadevOOo/tests/java/mod/_sw/PageStyle.java index 0f7564035a5e..9d41a288b57e 100644 --- a/qadevOOo/tests/java/mod/_sw/PageStyle.java +++ b/qadevOOo/tests/java/mod/_sw/PageStyle.java @@ -85,10 +85,10 @@ public class PageStyle extends TestCase { XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); XNameAccess oSF = oSFS.getStyleFamilies(); - oSFNA = (XNameAccess) UnoRuntime.queryInterface( + oSFNA = UnoRuntime.queryInterface( XNameAccess.class,oSF.getByName("PageStyles")); // get the page style XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); - oStyle = (XStyle) UnoRuntime.queryInterface( + oStyle = UnoRuntime.queryInterface( XStyle.class,oSFIA.getByIndex(0)); log.println("Chosen pool style: "+oStyle.getName()); @@ -112,7 +112,7 @@ public class PageStyle extends TestCase { XInterface oInt = (XInterface) oMSF.createInstance("com.sun.star.style.PageStyle"); // oMSF.createInstanceWithArguments("com.sun.star.style.PageStyle",new Object[]{oStyle}); - oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt); + oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt); } catch ( com.sun.star.uno.Exception e ) { log.println("Error: exception occurred."); e.printStackTrace(log); @@ -125,8 +125,7 @@ public class PageStyle extends TestCase { else log.println("OK"); - XNameContainer oSFNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oSFNA); + XNameContainer oSFNC = UnoRuntime.queryInterface(XNameContainer.class, oSFNA); try { @@ -149,8 +148,7 @@ public class PageStyle extends TestCase { XText oText = xTextDoc.getText(); XTextCursor oCursor = oText.createTextCursor(); - XPropertySet xProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oCursor); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, oCursor); Property[] props = xProp.getPropertySetInfo().getProperties(); for (int i=0; i<props.length; i++) System.out.println("# Property: " + props[i].Name + " val: " + props[i].Type.toString() + " attr: " + props[i].Attributes); @@ -176,8 +174,7 @@ public class PageStyle extends TestCase { tEnv.addObjRelation("PoolStyle", oStyle); tEnv.addObjRelation("FollowStyle", "Envelope"); - XPropertySet xStyleProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); + XPropertySet xStyleProp = UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); short exclude = PropertyAttribute.MAYBEVOID + PropertyAttribute.READONLY; String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude); diff --git a/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java index c0d95a6163be..68dddf1fc7ac 100644 --- a/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java +++ b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java @@ -85,11 +85,11 @@ public class ParagraphStyle extends TestCase { XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); XNameAccess oSF = oSFS.getStyleFamilies(); - oSFNA = (XNameAccess) UnoRuntime.queryInterface( + oSFNA = UnoRuntime.queryInterface( XNameAccess.class,oSF.getByName("ParagraphStyles")); XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); String[] els = oSFNA.getElementNames(); - oStyle = (XStyle) UnoRuntime.queryInterface( + oStyle = UnoRuntime.queryInterface( XStyle.class,oSFIA.getByIndex(1)); } catch ( com.sun.star.lang.WrappedTargetException e ) { log.println("Error: exception occurred."); @@ -110,7 +110,7 @@ public class ParagraphStyle extends TestCase { XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); XInterface oInt = (XInterface) oMSF.createInstance("com.sun.star.style.ParagraphStyle"); - oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt); + oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt); } catch ( com.sun.star.uno.Exception e ) { log.println("Error: exception occurred."); e.printStackTrace(log); @@ -122,8 +122,7 @@ public class ParagraphStyle extends TestCase { log.println("FAILED"); else log.println("OK"); - XNameContainer oSFNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oSFNA); + XNameContainer oSFNC = UnoRuntime.queryInterface(XNameContainer.class, oSFNA); try { if ( oSFNC.hasByName("My Style") ) @@ -145,8 +144,7 @@ public class ParagraphStyle extends TestCase { XText oText = xTextDoc.getText(); XTextCursor oCursor = oText.createTextCursor(); - XPropertySet xProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oCursor); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, oCursor); try { xProp.setPropertyValue("ParaStyleName", oMyStyle.getName()); @@ -168,8 +166,7 @@ public class ParagraphStyle extends TestCase { tEnv = new TestEnvironment(oMyStyle); tEnv.addObjRelation("PoolStyle", oStyle); - XPropertySet xStyleProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); + XPropertySet xStyleProp = UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); short exclude = PropertyAttribute.MAYBEVOID + PropertyAttribute.READONLY; String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude); tEnv.addObjRelation("PropertyNames", names); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java index 007f6a3171e8..768436f10513 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java @@ -69,7 +69,7 @@ public class SwAccessibleEndnoteView extends TestCase { XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); log.println("creating a endnote"); try { - oEndnote = (XInterface) UnoRuntime.queryInterface(XInterface.class, + oEndnote = UnoRuntime.queryInterface(XInterface.class, msf.createInstance("com.sun.star.text.Endnote")); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java index 95ecd52424e5..9e098cdd1e62 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java @@ -97,8 +97,7 @@ public class SwAccessibleFooterView extends TestCase { throw new StatusException("Error getting style by name!", e); } - final XPropertySet PropSet = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, StdStyle); + final XPropertySet PropSet = UnoRuntime.queryInterface( XPropertySet.class, StdStyle); // changing/getting some properties try { diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java index 544e27b1279c..d58bb3819084 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java @@ -95,8 +95,7 @@ public class SwAccessibleHeaderView extends TestCase { throw new StatusException("Error getting style by name!", e); } - final XPropertySet PropSet = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, StdStyle); + final XPropertySet PropSet = UnoRuntime.queryInterface( XPropertySet.class, StdStyle); // changing/getting some properties try { diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java index 8c183b6d41ec..4364ad03dfe9 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java @@ -125,10 +125,8 @@ public class SwAccessiblePageView extends TestCase { } try { - portP = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, port); - paraP = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, para); + portP = UnoRuntime.queryInterface(XPropertySet.class, port); + paraP = UnoRuntime.queryInterface(XPropertySet.class, para); paraP.setPropertyValue("BreakType",com.sun.star.style.BreakType.PAGE_AFTER); } catch ( com.sun.star.lang.WrappedTargetException e ) { log.println("Error, exception occurred..."); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java index 36679927caf4..f0071b6f76bc 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java @@ -84,7 +84,7 @@ public class SwAccessibleTextFrameView extends TestCase { log.println( "creating Frames" ); try { oFrame1 = SOF.createTextFrame(xTextDoc, 500, 500); - oPropSet = (XPropertySet)UnoRuntime.queryInterface( + oPropSet = UnoRuntime.queryInterface( XPropertySet.class, oFrame1 ); oPropSet.setPropertyValue("AnchorType", TextContentAnchorType.AS_CHARACTER); diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java index 0fdacdebbf3e..afa7c6ab6123 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java +++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java @@ -136,7 +136,7 @@ public class SwXAutoTextEntry extends TestCase { throw new StatusException("Couldn't create AutoTextContainer", e); } - XNameAccess oContNames = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oContainer); + XNameAccess oContNames = UnoRuntime.queryInterface(XNameAccess.class, oContainer); String contNames[] = oContNames.getElementNames(); for (int i =0; i < contNames.length; i++){ @@ -159,7 +159,7 @@ public class SwXAutoTextEntry extends TestCase { XText oText = xTextDoc.getText(); oText.insertString(oText.getStart(), "New AutoText", true); - XTextRange oTextRange = (XTextRange) oText; + XTextRange oTextRange = oText; try { if ( oGroup.hasByName("NewEntryName") ) { oGroup.removeByName("NewEntryName"); diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java index 232e634c2a90..3f2e802473b2 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java +++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java @@ -135,7 +135,7 @@ public class SwXAutoTextGroup extends TestCase { } - XNameAccess oContNames = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oContainer); + XNameAccess oContNames = UnoRuntime.queryInterface(XNameAccess.class, oContainer); if (Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)){ String contNames[] = oContNames.getElementNames(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXCellRange.java b/qadevOOo/tests/java/mod/_sw/SwXCellRange.java index 2d2c386e08b1..f65046d4d718 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXCellRange.java +++ b/qadevOOo/tests/java/mod/_sw/SwXCellRange.java @@ -111,8 +111,7 @@ public class SwXCellRange extends TestCase { } } try { - XCellRange the_Range = (XCellRange) - UnoRuntime.queryInterface(XCellRange.class, the_table); + XCellRange the_Range = UnoRuntime.queryInterface(XCellRange.class, the_table); oObj = the_Range.getCellRangeByPosition(0, 0, 3, 4); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java b/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java index 2e1e7d20e000..87d1dc9aa2b4 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java +++ b/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java @@ -91,7 +91,7 @@ public class SwXEndnoteProperties extends TestCase { XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); log.println("creating a endnote"); try { - oEndnote = (XInterface) UnoRuntime.queryInterface(XInterface.class, + oEndnote = UnoRuntime.queryInterface(XInterface.class, msf.createInstance("com.sun.star.text.Endnote")); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java b/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java index 39f4999e4a7f..67f80b319f1c 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java +++ b/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java @@ -107,8 +107,8 @@ public class SwXFieldEnumeration extends TestCase { try { FieldMaster = oDocMSF.createInstance ( "com.sun.star.text.FieldMaster.Database" ); - PFieldMaster = (XPropertySet) UnoRuntime.queryInterface - (XPropertySet.class,(XInterface) FieldMaster); + PFieldMaster = UnoRuntime.queryInterface + (XPropertySet.class,FieldMaster); oObj = (XInterface) oDocMSF.createInstance("com.sun.star.text.TextField.Database"); xTF = UnoRuntime.queryInterface(XDependentTextField.class,oObj); diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java b/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java index 6a563a6977a2..6c1edcb810a7 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java +++ b/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java @@ -148,7 +148,7 @@ public class SwXFootnoteText extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); log.println( "adding TextDocument as mod relation to environment" ); - tEnv.addObjRelation("TEXT", (XText) oObj); + tEnv.addObjRelation("TEXT", oObj); TextSectionDsc tDsc = new TextSectionDsc(); log.println( " adding InstCreator object" ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java b/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java index 580b7b95c260..28e111b3c36e 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java +++ b/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java @@ -141,8 +141,7 @@ public class SwXHeadFootText extends TestCase { throw new StatusException("Error getting style by name!", e); } - PropSet = (XPropertySet) - UnoRuntime.queryInterface( XPropertySet.class, StdStyle); + PropSet = UnoRuntime.queryInterface( XPropertySet.class, StdStyle); // changing/getting some properties try { diff --git a/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java b/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java index cdf3d693425f..a57fd9d6b21a 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java +++ b/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java @@ -105,8 +105,7 @@ public class SwXMailMerge extends TestCase { } catch (Exception e) { throw new StatusException("Can't create com.sun.star.sdb.RowSet", e); } - XPropertySet oRowSetProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oRowSet); + XPropertySet oRowSetProps = UnoRuntime.queryInterface(XPropertySet.class, oRowSet); XRowSet xRowSet = UnoRuntime.queryInterface(XRowSet.class, oRowSet); try { oRowSetProps.setPropertyValue("DataSourceName",cDataSourceName); @@ -150,8 +149,7 @@ public class SwXMailMerge extends TestCase { log.println("fill MailMerge with default connection"); - XPropertySet oObjProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet oObjProps = UnoRuntime.queryInterface(XPropertySet.class, oObj); try { oObjProps.setPropertyValue("ActiveConnection", getLocalXConnection(Param)); oObjProps.setPropertyValue("DataSourceName", cDataSourceName); @@ -222,7 +220,7 @@ public class SwXMailMerge extends TestCase { vXJobArgs[3] = vXJobArg3; - Job = (XJob) UnoRuntime.queryInterface(XJob.class, oObj); + Job = UnoRuntime.queryInterface(XJob.class, oObj); try{ Job.execute(vXJobArg2); } catch ( IllegalArgumentException e){ @@ -241,7 +239,7 @@ public class SwXMailMerge extends TestCase { } catch (Exception e) { throw new StatusException("Can't create com.sun.star.sdb.RowSet", e); } - oRowSetProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRowSet); + oRowSetProps = UnoRuntime.queryInterface(XPropertySet.class, oRowSet); xRowSet = UnoRuntime.queryInterface(XRowSet.class, oRowSet); @@ -269,9 +267,8 @@ public class SwXMailMerge extends TestCase { XResultSet oMMXResultSet = null; try { oMMXResultSet = UnoRuntime.queryInterface(XResultSet.class, - ( (XInterface) - ( (XMultiServiceFactory) - Param.getMSF()).createInstance("com.sun.star.sdb.RowSet"))); + ( (XMultiServiceFactory) + Param.getMSF()).createInstance("com.sun.star.sdb.RowSet")); } catch (Exception e) { throw new StatusException("Can't create com.sun.star.sdb.RowSet", e); @@ -332,8 +329,7 @@ public class SwXMailMerge extends TestCase { XInterface newSource = (XInterface) xMSF.createInstance ("com.sun.star.sdb.DataSource") ; - XPropertySet xSrcProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, newSource); + XPropertySet xSrcProp = UnoRuntime.queryInterface(XPropertySet.class, newSource); xSrcProp.setPropertyValue("URL", tmpDatabaseUrl) ; @@ -367,8 +363,7 @@ public class SwXMailMerge extends TestCase { } catch(Exception e) { throw new StatusException("Couldn't create instance of 'com.sun.star.sdb.DatabaseContext'", e); } - XNameAccess xNADataCont = (XNameAccess) - UnoRuntime.queryInterface(XNameAccess.class, oDataCont); + XNameAccess xNADataCont = UnoRuntime.queryInterface(XNameAccess.class, oDataCont); String[] dataNames = xNADataCont.getElementNames(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java b/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java index f2700b03095c..d88fc9516c9c 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java +++ b/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java @@ -138,8 +138,7 @@ public class SwXNumberingRules extends TestCase { try { oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),NumStyleI.getByIndex(0)); - XPropertySet props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + XPropertySet props = UnoRuntime.queryInterface(XPropertySet.class, oObj); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),props.getPropertyValue("NumberingRules")); XIndexAccess nRules = UnoRuntime.queryInterface(XIndexAccess.class, props.getPropertyValue("NumberingRules")); diff --git a/qadevOOo/tests/java/mod/_sw/SwXParagraph.java b/qadevOOo/tests/java/mod/_sw/SwXParagraph.java index 3520338d5b0c..7a2e85b3659c 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXParagraph.java +++ b/qadevOOo/tests/java/mod/_sw/SwXParagraph.java @@ -212,10 +212,8 @@ public class SwXParagraph extends TestCase { } try { - portP = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, port); - paraP = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, para); + portP = UnoRuntime.queryInterface(XPropertySet.class, port); + paraP = UnoRuntime.queryInterface(XPropertySet.class, para); paraP.setPropertyValue("NumberingStyleName","Numbering 4"); nRules = paraP.getPropertyValue("NumberingRules"); } catch ( com.sun.star.lang.WrappedTargetException e ) { diff --git a/qadevOOo/tests/java/mod/_sw/SwXPropertySetInfo.java b/qadevOOo/tests/java/mod/_sw/SwXPropertySetInfo.java index b756da47b7ad..1971579eb332 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXPropertySetInfo.java +++ b/qadevOOo/tests/java/mod/_sw/SwXPropertySetInfo.java @@ -75,8 +75,7 @@ public class SwXPropertySetInfo extends TestCase { } log.println( " getting the XPropertySetInfo" ); - XPropertySet xProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xTextDoc); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xTextDoc); oObj = xProp.getPropertySetInfo(); log.println( " creating a new environment for PropertySetInfo object" ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java b/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java index 6fc12bc9ad31..c345785dae87 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java +++ b/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java @@ -99,7 +99,7 @@ public class SwXReferenceMark extends TestCase { try { oObj = (XInterface) oDocMSF.createInstance ("com.sun.star.text.ReferenceMark"); - instance = (XInterface) oDocMSF.createInstance + instance = oDocMSF.createInstance ("com.sun.star.text.ReferenceMark"); } catch ( com.sun.star.uno.Exception e ) { e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXStyle.java b/qadevOOo/tests/java/mod/_sw/SwXStyle.java index 640295b53ebe..0371ffe866b0 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXStyle.java +++ b/qadevOOo/tests/java/mod/_sw/SwXStyle.java @@ -146,7 +146,7 @@ public class SwXStyle extends TestCase { XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); XInterface oInt = (XInterface) oMSF.createInstance("com.sun.star.style.CharacterStyle"); - oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt); + oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt); } catch ( com.sun.star.uno.Exception e ) { log.println("Error: exception occurred."); e.printStackTrace(log); @@ -158,8 +158,7 @@ public class SwXStyle extends TestCase { log.println("FAILED"); else log.println("OK"); - XNameContainer oSFNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oSFNA); + XNameContainer oSFNC = UnoRuntime.queryInterface(XNameContainer.class, oSFNA); try { if ( oSFNC.hasByName("My Style") ) @@ -181,8 +180,7 @@ public class SwXStyle extends TestCase { XText oText = xTextDoc.getText(); XTextCursor oCursor = oText.createTextCursor(); - XPropertySet xProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oCursor); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, oCursor); try { xProp.setPropertyValue("CharStyleName", oMyStyle.getName()); @@ -204,8 +202,7 @@ public class SwXStyle extends TestCase { tEnv = new TestEnvironment(oMyStyle); tEnv.addObjRelation("PoolStyle", oStyle); - XPropertySet xStyleProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); + XPropertySet xStyleProp = UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); tEnv.addObjRelation("PropertyNames",getPropertyNames(xStyleProp)); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java b/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java index 3ba157938b76..e2fdb12febd6 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java +++ b/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java @@ -142,8 +142,7 @@ public class SwXStyleFamily extends TestCase { throw new StatusException("Unexpected exception. ", e); } - XNameContainer oContainer = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oSFNA); + XNameContainer oContainer = UnoRuntime.queryInterface(XNameContainer.class, oSFNA); // insert a Style which can be replaced by name try { diff --git a/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java b/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java index cc59873ab331..cae0cde49251 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java @@ -144,7 +144,7 @@ public class SwXTableCellText extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); log.println( "adding TextDocument as mod relation to environment" ); - tEnv.addObjRelation("TEXT", (XText) oObj); + tEnv.addObjRelation("TEXT", oObj); log.println( " adding InstCreator object" ); TextSectionDsc tDsc = new TextSectionDsc(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java b/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java index 98a073d32dad..7d4746ab1ac3 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java @@ -125,8 +125,7 @@ public class SwXTextColumns extends TestCase { try { log.println("Getting property ('TextColumns') value of style " + oStyle.getName()); - XPropertySet xProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oStyle); + XPropertySet xProps = UnoRuntime.queryInterface(XPropertySet.class,oStyle); oObj = (XTextColumns) AnyConverter.toObject( new Type(XTextColumns.class),xProps.getPropertyValue("TextColumns")); } catch ( com.sun.star.lang.WrappedTargetException e ) { diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java b/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java index 7f943e2bca76..c175421a1d53 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java @@ -174,7 +174,7 @@ public class SwXTextCursor extends TestCase { tEnv.addObjRelation("XTEXT", xTextDoc.getText()); - XPropertySet xCursorProp = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet xCursorProp = UnoRuntime.queryInterface( XPropertySet.class, oObj); tEnv.addObjRelation("PropertyNames", getPropertyNames(xCursorProp)); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java index b6c1d07c7fa9..96bb97faa565 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java @@ -148,7 +148,7 @@ public class SwXTextDocument extends TestCase { oTSSuppName); log.println( "getting a TextSection with the XTextSectionSupplier()"); - xTS = (XTextSection) UnoRuntime.queryInterface(XTextSection.class, + xTS = UnoRuntime.queryInterface(XTextSection.class, oTSSuppIndex.getByIndex(0)); XNamed xTSName = UnoRuntime.queryInterface(XNamed.class, @@ -162,7 +162,7 @@ public class SwXTextDocument extends TestCase { the_table); the_name.setName("SwXTextDocument"); SOfficeFactory.insertTextContent(xTextDoc, - (XTextContent) the_table); + the_table); log.println(" adding ReferenceMark"); @@ -173,7 +173,7 @@ public class SwXTextDocument extends TestCase { XTextContent oTC = UnoRuntime.queryInterface( XTextContent.class, aMark); - SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC); + SOfficeFactory.insertTextContent(xTextDoc, oTC); log.println(" adding TextGraphic"); WriterTools.insertTextGraphic(xTextDoc, oDocMSF, 5200, 4200, 4400, @@ -186,17 +186,17 @@ public class SwXTextDocument extends TestCase { "com.sun.star.text.Endnote"); oTC = UnoRuntime.queryInterface(XTextContent.class, aEndNote); - SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC); + SOfficeFactory.insertTextContent(xTextDoc, oTC); log.println(" adding Bookmark"); SOfficeFactory.insertTextContent(xTextDoc, - (XTextContent) SOfficeFactory.createBookmark( + SOfficeFactory.createBookmark( xTextDoc)); log.println(" adding DocumentIndex"); oTC = SOfficeFactory.createIndex(xTextDoc, "com.sun.star.text.DocumentIndex"); - SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC); + SOfficeFactory.insertTextContent(xTextDoc, oTC); log.println(" adding TextFrame"); @@ -204,7 +204,7 @@ public class SwXTextDocument extends TestCase { 500); oTC = UnoRuntime.queryInterface(XTextContent.class, frame); - SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC); + SOfficeFactory.insertTextContent(xTextDoc, oTC); log.println("creating a second textdocument"); xSecondTextDoc = WriterTools.createTextDoc( diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java index 3fcbd3687ba8..64ef1bfbf3ab 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java @@ -111,14 +111,13 @@ public class SwXTextEmbeddedObject extends TestCase { Object o = xMultiServiceFactory.createInstance("com.sun.star.text.TextEmbeddedObject" ); XTextContent xTextContent = UnoRuntime.queryInterface(XTextContent.class, o); String sChartClassID = "12dcae26-281f-416f-a234-c3086127382e"; - XPropertySet xPropertySet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xTextContent); + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xTextContent); xPropertySet.setPropertyValue( "CLSID", sChartClassID ); xTextDoc.getText().insertTextContent( xCursor, xTextContent, false ); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace((java.io.PrintWriter)log); + e.printStackTrace(log); } XTextEmbeddedObjectsSupplier oTEOS = UnoRuntime.queryInterface( diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java index b1e209575d03..5a477f5ed48f 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java @@ -103,14 +103,13 @@ public class SwXTextEmbeddedObjects extends TestCase { Object o = xMultiServiceFactory.createInstance("com.sun.star.text.TextEmbeddedObject" ); XTextContent xTextContent = UnoRuntime.queryInterface(XTextContent.class, o); String sChartClassID = "12dcae26-281f-416f-a234-c3086127382e"; - XPropertySet xPropertySet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xTextContent); + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xTextContent); xPropertySet.setPropertyValue( "CLSID", sChartClassID ); oDoc.getText().insertTextContent( xCursor, xTextContent, false ); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace((java.io.PrintWriter)log); + e.printStackTrace(log); } XTextEmbeddedObjectsSupplier oTEOS = UnoRuntime.queryInterface(XTextEmbeddedObjectsSupplier.class, oDoc); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextField.java b/qadevOOo/tests/java/mod/_sw/SwXTextField.java index 3de89f88e159..88a912036fcc 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextField.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextField.java @@ -117,12 +117,12 @@ public class SwXTextField extends TestCase { Object FieldMaster = oDocMSF.createInstance ( "com.sun.star.text.FieldMaster.Database" ); - XPropertySet PFieldMaster = (XPropertySet) UnoRuntime.queryInterface - (XPropertySet.class,(XInterface) FieldMaster); + XPropertySet PFieldMaster = UnoRuntime.queryInterface + (XPropertySet.class,FieldMaster); oObj = (XInterface) oDocMSF.createInstance ( "com.sun.star.text.TextField.Database" ); - instance = (XInterface) oDocMSF.createInstance + instance = oDocMSF.createInstance ( "com.sun.star.text.TextField.DateTime" ); XDependentTextField xTF = UnoRuntime.queryInterface(XDependentTextField.class,oObj); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java b/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java index 05127431b3a5..7f7b54b6be5a 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java @@ -94,7 +94,7 @@ public class SwXTextFrame extends TestCase { try { oFrame1 = SOF.createTextFrame(xTextDoc, 500, 500); oFrame2 = SOF.createTextFrame(xTextDoc, 1500, 1500); - oPropSet = (XPropertySet) UnoRuntime.queryInterface( + oPropSet = UnoRuntime.queryInterface( XPropertySet.class, oFrame1); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java b/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java index a083cf58a378..41302376bc21 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java @@ -102,7 +102,7 @@ public class SwXTextFrameText extends TestCase { try { oFrame1 = SOF.createTextFrame(xTextDoc, 500, 500); - oPropSet = (XPropertySet)UnoRuntime.queryInterface + oPropSet = UnoRuntime.queryInterface (XPropertySet.class, oFrame1 ); //AnchorTypes: 0 = paragraph, 1 = as char, 2 = page, // 3 = frame/paragraph 4= at char @@ -128,7 +128,7 @@ public class SwXTextFrameText extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); log.println( "adding TextDocument as mod relation to environment" ); - tEnv.addObjRelation("TEXT", (XText) oObj); + tEnv.addObjRelation("TEXT", oObj); log.println( "adding InstDescriptor object" ); TableDsc tDsc = new TableDsc( 6, 4 ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java index 9956a8f93fd3..632b941674d0 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java @@ -142,8 +142,7 @@ public class SwXTextGraphicObject extends TestCase { } log.println( "adding graphic" ); - XPropertySet oProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oObj); + XPropertySet oProps = UnoRuntime.queryInterface(XPropertySet.class,oObj); try { String wat = util.utils.getFullTestURL("space-metal.jpg"); oProps.setPropertyValue("AnchorType", diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java index 3a0ec080f562..37588d1a9f63 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java @@ -125,8 +125,7 @@ public class SwXTextGraphicObjects extends TestCase { } log.println( "adding graphic" ); - XPropertySet oProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oObj); + XPropertySet oProps = UnoRuntime.queryInterface(XPropertySet.class,oObj); try { String wat = util.utils.getFullTestURL("space-metal.jpg"); oProps.setPropertyValue("GraphicURL",wat); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java b/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java index b5c816ca3dfc..98b057f86e78 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java @@ -148,10 +148,8 @@ public class SwXTextPortion extends TestCase { throw new StatusException( "Couldn't get TextPortion", e ); } - portP = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); - paraP = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, param); + portP = UnoRuntime.queryInterface(XPropertySet.class, oObj); + paraP = UnoRuntime.queryInterface(XPropertySet.class, param); log.println( "creating a new environment for Paragraph object" ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextSection.java b/qadevOOo/tests/java/mod/_sw/SwXTextSection.java index e8ff1259a720..cea7b360bdb8 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextSection.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextSection.java @@ -150,7 +150,7 @@ public class SwXTextSection extends TestCase { tEnv.addObjRelation("TRO",new Boolean(true)); try { - TC = (XTextColumns) UnoRuntime.queryInterface(XTextColumns.class, + TC = UnoRuntime.queryInterface(XTextColumns.class, oDocMSF.createInstance("com.sun.star.text.TextColumns")); } catch ( com.sun.star.uno.Exception e ) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextTable.java b/qadevOOo/tests/java/mod/_sw/SwXTextTable.java index db5f8d3b4a97..f97032b4daa7 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextTable.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextTable.java @@ -111,7 +111,7 @@ public class SwXTextTable extends TestCase { } } - XPropertySet props = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet props = UnoRuntime.queryInterface( XPropertySet.class, oObj); try { diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java b/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java index d1ed329ee344..7c2522fb6756 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java @@ -77,7 +77,7 @@ public class SwXTextTableRow extends TestCase { try { log.println("creating a texttable"); - oTable = (XTextTable) SOF.createTextTable(xTextDoc,5,5); + oTable = SOF.createTextTable(xTextDoc,5,5); } catch( Exception e ) { e.printStackTrace(log); } diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextView.java b/qadevOOo/tests/java/mod/_sw/SwXTextView.java index b27c77da8510..b01971dab125 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextView.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextView.java @@ -175,12 +175,10 @@ public class SwXTextView extends TestCase { tEnv.addObjRelation("Selections", new Object[] { oFrame1, oFrame2, textRanges1, textRanges2}); - tEnv.addObjRelation("Comparer", new Comparator() { + tEnv.addObjRelation("Comparer", new Comparator<Object>() { public int compare(Object o1, Object o2) { - XServiceInfo serv1 = (XServiceInfo) - UnoRuntime.queryInterface(XServiceInfo.class, o1); - XServiceInfo serv2 = (XServiceInfo) - UnoRuntime.queryInterface(XServiceInfo.class, o2); + XServiceInfo serv1 = UnoRuntime.queryInterface(XServiceInfo.class, o1); + XServiceInfo serv2 = UnoRuntime.queryInterface(XServiceInfo.class, o2); String implName1 = serv1.getImplementationName(); String implName2 = serv2.getImplementationName(); @@ -206,9 +204,7 @@ public class SwXTextView extends TestCase { return -1; } - public boolean equals(Object obj) { - return compare(this, obj) == 0; - } }); + }); XSelectionSupplier xsel = UnoRuntime.queryInterface(XSelectionSupplier.class,xContr); try { @@ -237,7 +233,7 @@ public class SwXTextView extends TestCase { log.println("adding relation for com.sun.star.view.XFormLayerAccess: XForm"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); try { diff --git a/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java b/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java index b5ce7ab8412c..8f7603a37eb1 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java @@ -129,7 +129,7 @@ public class XMLContentExporter extends TestCase { // text added to the document XSimpleText aText = xTextDoc.getText(); - XTextCursor curs = (XTextCursor) aText.createTextCursor(); + XTextCursor curs = aText.createTextCursor(); aText.insertString(curs, CONTENT, false); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log) ; diff --git a/qadevOOo/tests/java/mod/_sw/XMLExporter.java b/qadevOOo/tests/java/mod/_sw/XMLExporter.java index 66bcc8971825..b1c3d39b4b36 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLExporter.java @@ -128,7 +128,7 @@ public class XMLExporter extends TestCase { xEx.setSourceDocument(xTextDoc); XSimpleText aText = xTextDoc.getText(); - XTextCursor curs = (XTextCursor) aText.createTextCursor(); + XTextCursor curs = aText.createTextCursor(); aText.insertString(curs, TEST_STR, false); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log) ; diff --git a/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java index 52df6783e384..dadcd90ddbd5 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java @@ -131,7 +131,7 @@ public class XMLMetaExporter extends TestCase { //set some meta data XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xTextDoc) ; - XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; docInfo.setPropertyValue("Title", TITLE); diff --git a/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java index 6b24e0232efb..c234003caf8c 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java @@ -155,7 +155,7 @@ public class XMLMetaImporter extends TestCase { XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xTextDoc) ; - final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + final XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; final PrintWriter logF = log ; diff --git a/qadevOOo/tests/java/mod/_tdmgr/TypeDescriptionManager.java b/qadevOOo/tests/java/mod/_tdmgr/TypeDescriptionManager.java index e018ba2f8e6a..bde66fc4d2c0 100644 --- a/qadevOOo/tests/java/mod/_tdmgr/TypeDescriptionManager.java +++ b/qadevOOo/tests/java/mod/_tdmgr/TypeDescriptionManager.java @@ -48,12 +48,11 @@ public class TypeDescriptionManager extends TestCase { try { XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF(); - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet xProp = UnoRuntime.queryInterface( XPropertySet.class, xMSF); // get context - XComponentContext xContext = (XComponentContext) - UnoRuntime.queryInterface(XComponentContext.class, - xProp.getPropertyValue("DefaultContext")); + XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, + xProp.getPropertyValue("DefaultContext")); // get the type description manager from context oInterface = xContext.getValueByName("/singletons/" + "com.sun.star.reflection.theTypeDescriptionManager"); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java index 8810e79b33ff..01a7ab25e91c 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java @@ -235,7 +235,7 @@ public class AccessibleTabControl extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleSelection selection = (XAccessibleSelection) UnoRuntime.queryInterface( + final XAccessibleSelection selection = UnoRuntime.queryInterface( XAccessibleSelection.class, oObj); diff --git a/qadevOOo/tests/java/mod/_toolkit/TabController.java b/qadevOOo/tests/java/mod/_toolkit/TabController.java index 8730b99cd2e9..72ebe93560b1 100644 --- a/qadevOOo/tests/java/mod/_toolkit/TabController.java +++ b/qadevOOo/tests/java/mod/_toolkit/TabController.java @@ -83,7 +83,7 @@ public class TabController extends TestCase { 10000, "CommandButton", "UnoControlButton"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel model = aShape.getControl(); XControlAccess access = UnoRuntime.queryInterface( diff --git a/qadevOOo/tests/java/mod/_toolkit/Toolkit.java b/qadevOOo/tests/java/mod/_toolkit/Toolkit.java index e4e3ddc36bdb..c18e01c50b98 100644 --- a/qadevOOo/tests/java/mod/_toolkit/Toolkit.java +++ b/qadevOOo/tests/java/mod/_toolkit/Toolkit.java @@ -85,7 +85,7 @@ public class Toolkit extends TestCase { 4500, 15000, 10000, "CommandButton"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java index 30247d29dbee..3667d1695f3b 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java @@ -89,7 +89,7 @@ public class UnoControlButton extends TestCase { "CommandButton", "UnoControlButton"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java index b5a67eb9acde..dded17ac6c33 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java @@ -90,7 +90,7 @@ public class UnoControlCheckBox extends TestCase { "CheckBox", "UnoControlCheckBox"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java index 9994981195fa..8f1202df0af8 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java @@ -84,7 +84,7 @@ util.DesktopTools.closeDoc(xTextDoc); "ComboBox", "UnoControlComboBox"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -92,7 +92,7 @@ util.DesktopTools.closeDoc(xTextDoc); 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java index 8886950357af..47d4fca4030d 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java @@ -99,7 +99,7 @@ public class UnoControlContainer extends TestCase { // create first XControl shape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) shape); + WriterTools.getDrawPage(xTextDoc).add(shape); model = shape.getControl(); access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -115,7 +115,7 @@ public class UnoControlContainer extends TestCase { // create second XControl shape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) shape); + WriterTools.getDrawPage(xTextDoc).add(shape); model = shape.getControl(); access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -131,7 +131,7 @@ public class UnoControlContainer extends TestCase { // create third XControl shape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000, 10000, "CommandButton"); - WriterTools.getDrawPage(xTextDoc).add((XShape) shape); + WriterTools.getDrawPage(xTextDoc).add(shape); model = shape.getControl(); access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -151,7 +151,7 @@ public class UnoControlContainer extends TestCase { "CommandButton", "UnoControlButton"); - WriterTools.getDrawPage(xTD2).add((XShape) aShape); + WriterTools.getDrawPage(xTD2).add(aShape); XControlModel the_Model = aShape.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java index 6950343d205f..abec47b268ef 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java @@ -85,7 +85,7 @@ public class UnoControlCurrencyField extends TestCase { "CurrencyField", "UnoControlCurrencyField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -93,7 +93,7 @@ public class UnoControlCurrencyField extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java index 0beb53871adc..edace2a7197c 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java @@ -90,7 +90,7 @@ public class UnoControlDateField extends TestCase { "DateField", "UnoControlDateField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java index f254bf745f33..1d8f50e365f8 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java @@ -84,7 +84,7 @@ public class UnoControlDialogModel extends TestCase { "com.sun.star.awt.UnoControlDialogModel"); // create the dialog model and set the properties - XPropertySet xPSetDialog = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet xPSetDialog = UnoRuntime.queryInterface( XPropertySet.class, dialogModel); xPSetDialog.setPropertyValue("PositionX", new Integer(100)); xPSetDialog.setPropertyValue("PositionY", new Integer(100)); @@ -102,7 +102,7 @@ public class UnoControlDialogModel extends TestCase { // create the button model and set the properties Object buttonModel = xMultiServiceFactory.createInstance( "com.sun.star.awt.UnoControlButtonModel"); - XPropertySet xPSetButton = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet xPSetButton = UnoRuntime.queryInterface( XPropertySet.class, buttonModel); xPSetButton.setPropertyValue("PositionX", new Integer(50)); xPSetButton.setPropertyValue("PositionY", new Integer(30)); @@ -115,7 +115,7 @@ public class UnoControlDialogModel extends TestCase { // create the label model and set the properties Object labelModel = xMultiServiceFactory.createInstance( "com.sun.star.awt.UnoControlFixedTextModel"); - XPropertySet xPSetLabel = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet xPSetLabel = UnoRuntime.queryInterface( XPropertySet.class, labelModel); xPSetLabel.setPropertyValue("PositionX", new Integer(40)); xPSetLabel.setPropertyValue("PositionY", new Integer(60)); @@ -126,7 +126,7 @@ public class UnoControlDialogModel extends TestCase { xPSetLabel.setPropertyValue("Label", _labelPrefix); // insert the control models into the dialog model - XNameContainer xNameCont = (XNameContainer) UnoRuntime.queryInterface( + XNameContainer xNameCont = UnoRuntime.queryInterface( XNameContainer.class, dialogModel); xNameCont.insertByName(_buttonName, buttonModel); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java index 8815295c239c..f9a597d5e9a0 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java @@ -85,7 +85,7 @@ public class UnoControlEdit extends TestCase { "TextField", "UnoControlEdit"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -93,7 +93,7 @@ public class UnoControlEdit extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java index d259ffdc90bd..327578348a70 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java @@ -85,7 +85,7 @@ public class UnoControlFileControl extends TestCase { "FileControl", "UnoControlFileControl"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -93,7 +93,7 @@ public class UnoControlFileControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java index 18d3c00d67d5..ff3766a4fb00 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java @@ -84,7 +84,7 @@ public class UnoControlFixedText extends TestCase { "FixedText", "UnoControlFixedText"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -92,7 +92,7 @@ public class UnoControlFixedText extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java index c46b879f8ed6..6583ec57ab38 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java @@ -86,7 +86,7 @@ public class UnoControlFormattedField extends TestCase { "DatabaseFormattedField", "UnoControlFormattedField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -94,11 +94,11 @@ public class UnoControlFormattedField extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); - XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet xPS = UnoRuntime.queryInterface( XPropertySet.class, the_Model); //Try to query XControlAccess diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java index 86761173d7d6..fa2d1b4abc1a 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java @@ -84,7 +84,7 @@ public class UnoControlGroupBox extends TestCase { "GroupBox", "UnoControlGroupBox"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -92,7 +92,7 @@ public class UnoControlGroupBox extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java index ea60ce757147..2b73cdd45bd8 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java @@ -85,18 +85,18 @@ public class UnoControlImageControl extends TestCase { "DatabaseImageControl", "UnoControlImageControl"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); - XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet xPS = UnoRuntime.queryInterface( XPropertySet.class, the_Model); XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000, 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java index 5d027152af12..6f8896077b97 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java @@ -85,7 +85,7 @@ public class UnoControlListBox extends TestCase { "ListBox", "UnoControlListBox"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -93,7 +93,7 @@ public class UnoControlListBox extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java index a49384e924f2..c5db88db77c4 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java @@ -92,7 +92,7 @@ public class UnoControlNumericField extends TestCase { "NumericField", "UnoControlNumericField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -100,7 +100,7 @@ public class UnoControlNumericField extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java index 766d1eb07839..b8d64230ec6d 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java @@ -85,7 +85,7 @@ public class UnoControlPatternField extends TestCase { "PatternField", "UnoControlPatternField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -93,7 +93,7 @@ public class UnoControlPatternField extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java index 593bd53cdd70..9b223c106ce2 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java @@ -84,7 +84,7 @@ public class UnoControlRadioButton extends TestCase { "RadioButton", "UnoControlRadioButton"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -92,7 +92,7 @@ public class UnoControlRadioButton extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java index de9cf193df10..a9b46671644a 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java @@ -85,7 +85,7 @@ public class UnoControlTimeField extends TestCase { "TimeField", "UnoControlTimeField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -93,7 +93,7 @@ public class UnoControlTimeField extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java index c331429494b3..57b15539be4e 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java @@ -107,7 +107,7 @@ public class UnoScrollBarControl extends TestCase { "ScrollBar", "UnoControlScrollBar"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -115,7 +115,7 @@ public class UnoScrollBarControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java index 8f10bfa41104..4320d300ba8e 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java @@ -75,7 +75,7 @@ public class UnoSpinButtonControl extends TestCase { "SpinButton", "UnoControlSpinButton"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); + WriterTools.getDrawPage(xTextDoc).add(aShape); XControlModel the_Model = aShape.getControl(); @@ -83,7 +83,7 @@ public class UnoSpinButtonControl extends TestCase { 4500, 5000, 10000, "TextField"); - WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); + WriterTools.getDrawPage(xTextDoc).add(aShape2); XControlModel the_Model2 = aShape2.getControl(); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java index eee6fa0f5000..570e12d588c8 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java @@ -107,7 +107,7 @@ public class UnoTreeControl extends TestCase { XControlModel xDialogModel = UnoRuntime.queryInterface(XControlModel.class, mxMSF.createInstance("com.sun.star.awt.UnoControlDialogModel")); - XPropertySet xDialogPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xDialogModel); + XPropertySet xDialogPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xDialogModel); xDialogPropertySet.setPropertyValue( "PositionX", new Integer(50) ); xDialogPropertySet.setPropertyValue( "PositionY", new Integer(50) ); xDialogPropertySet.setPropertyValue( "Width", new Integer(256) ); @@ -119,7 +119,7 @@ public class UnoTreeControl extends TestCase { XControlModel xTreeControlModel = UnoRuntime.queryInterface(XControlModel.class, xDialogMSF.createInstance("com.sun.star.awt.tree.TreeControlModel")); - XPropertySet XTreeControlModelSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTreeControlModel); + XPropertySet XTreeControlModelSet = UnoRuntime.queryInterface(XPropertySet.class, xTreeControlModel); XTreeControlModelSet.setPropertyValue( "SelectionType",com.sun.star.view.SelectionType.NONE); XTreeControlModelSet.setPropertyValue( "PositionX", new Integer(3 )); @@ -132,8 +132,7 @@ public class UnoTreeControl extends TestCase { XTreeControlModelSet.setPropertyValue( "RootDisplayed", new Boolean (true)); XTreeControlModelSet.setPropertyValue( "Editable", new Boolean (true )); - XNameContainer xDialogModelContainer = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, xDialogModel); + XNameContainer xDialogModelContainer = UnoRuntime.queryInterface(XNameContainer.class, xDialogModel); xDialogModelContainer.insertByName( sTreeControlName, xTreeControlModel); @@ -181,7 +180,7 @@ public class UnoTreeControl extends TestCase { } tEnv.addObjRelation("Comparer", - new Comparator() { + new Comparator<Object>() { public int compare(Object o1, Object o2) { XMutableTreeNode xNode1 = UnoRuntime.queryInterface( XMutableTreeNode.class, o1); @@ -195,7 +194,7 @@ public class UnoTreeControl extends TestCase { XMutableTreeNode xNode2 = UnoRuntime.queryInterface( XMutableTreeNode.class, xNode2a); - if (((String) xNode1.getDataValue()).equals((String)xNode2.getDataValue())) { + if (((String) xNode1.getDataValue()).equals(xNode2.getDataValue())) { return 0; } diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java index c7922f7f342f..be1f603ad3fb 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java @@ -130,7 +130,7 @@ public class XMLContentExporter extends TestCase { xEx.setSourceDocument(xChartDoc); Object oTitle = xChartDoc.getTitle() ; - XPropertySet xTitleProp = (XPropertySet) UnoRuntime.queryInterface + XPropertySet xTitleProp = UnoRuntime.queryInterface (XPropertySet.class, oTitle) ; xTitleProp.setPropertyValue("String", exportStr) ; } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java index f78b779bee62..6e6cc2646735 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java @@ -132,7 +132,7 @@ public class XMLContentImporter extends TestCase { Object oTitle = xChartDoc.getTitle() ; - xTitleProp = (XPropertySet) UnoRuntime.queryInterface + xTitleProp = UnoRuntime.queryInterface (XPropertySet.class, oTitle) ; } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log) ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java index 82b1a43a5f95..eece10c34068 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java @@ -131,7 +131,7 @@ public class XMLExporter extends TestCase { xEx.setSourceDocument(xChartDoc); Object oTitle = xChartDoc.getTitle() ; - XPropertySet xTitleProp = (XPropertySet) UnoRuntime.queryInterface + XPropertySet xTitleProp = UnoRuntime.queryInterface (XPropertySet.class, oTitle) ; xTitleProp.setPropertyValue("String", exportStr) ; } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java index ac381a634347..40c47b6e9a12 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java @@ -130,7 +130,7 @@ public class XMLImporter extends TestCase { oInt = xMSF.createInstance("com.sun.star.comp.Chart.XMLImporter") ; Object oTitle = xChartDoc.getTitle() ; - xTitleProp = (XPropertySet) UnoRuntime.queryInterface + xTitleProp = UnoRuntime.queryInterface (XPropertySet.class, oTitle) ; } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log) ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java index 287695778987..3007c80c8bb1 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java @@ -142,12 +142,10 @@ public class XMLContentExporter extends TestCase { // can not be exported to XML) set.insertNewByIndex(1); - XDrawPage page1 = (XDrawPage) - UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0)); + XDrawPage page1 = UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0)); XNamed NPage1 = UnoRuntime.queryInterface(XNamed.class,page1); NPage1.setName("NewSlide1"); - XDrawPage page2 = (XDrawPage) - UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1)); + XDrawPage page2 = UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1)); XNamed NPage2 = UnoRuntime.queryInterface(XNamed.class,page2); NPage2.setName("NewSlide2"); xEx.setSourceDocument(xDrawDoc); diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java index 9bce636bb357..3730d72e000c 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java @@ -141,12 +141,10 @@ public class XMLExporter extends TestCase { // This is an XML-export BUG (new slide named "NewSlide2" can not be exported to XML) set.insertNewByIndex(1); - XDrawPage page1 = (XDrawPage) - UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0)); + XDrawPage page1 = UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0)); XNamed NPage1 = UnoRuntime.queryInterface(XNamed.class,page1); NPage1.setName("NewSlide1"); - XDrawPage page2 = (XDrawPage) - UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1)); + XDrawPage page2 = UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1)); XNamed NPage2 = UnoRuntime.queryInterface(XNamed.class,page2); NPage2.setName("NewSlide2"); diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java index e572aeb7c13f..01b61cb665f7 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java @@ -130,7 +130,7 @@ public class XMLMetaExporter extends TestCase { //set some meta data XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xDrawDoc) ; - XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; docInfo.setPropertyValue("Title", TITLE); diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java index 7c951ad28ab8..1fbfb34922c8 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java @@ -154,7 +154,7 @@ public class XMLMetaImporter extends TestCase { //set some meta data XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xDrawDoc); - final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + final XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()); final PrintWriter logF = log ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java index 5b6ff5b1df0b..3197070f159d 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java @@ -131,8 +131,7 @@ public class XMLSettingsExporter extends TestCase { //set some settings XModel xDrawModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XController xController = xDrawModel.getCurrentController(); - XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); xPropSet.setPropertyValue("IsLayerMode", new Boolean("true")); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java index 1872604bba32..7debe8e434f6 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java @@ -164,8 +164,7 @@ public class XMLSettingsImporter extends TestCase { final PrintWriter logF = log; XModel xDrawModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XController xController = xDrawModel.getCurrentController(); - final XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + final XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); tEnv.addObjRelation("XDocumentHandler.ImportChecker", new ifc.xml.sax._XDocumentHandler.ImportChecker() { diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java index c964b0c31a61..8f6bc82ffcd1 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java @@ -138,11 +138,10 @@ public class XMLStylesExporter extends TestCase { String styleFamilyName = styleFamiliesNames[0]; //obtain style family with name[0] Object objectStyle = StyleFamilies.getByName(styleFamilyName); - XNameContainer xStyleFamilyName = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, objectStyle); + XNameContainer xStyleFamilyName = UnoRuntime.queryInterface(XNameContainer.class, objectStyle); //creat new style Object SC = SOF.createInstance(xDrawDoc, "com.sun.star.style.Style"); - XStyle Style = (XStyle) UnoRuntime.queryInterface(XStyle.class,SC); + XStyle Style = UnoRuntime.queryInterface(XStyle.class,SC); //add new style to style familiy with name[0] xStyleFamilyName.insertByName(STYLE_NAME,Style); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java index aa067b04b939..d5981a0f9614 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java @@ -166,9 +166,8 @@ public class XMLStylesImporter extends TestCase { try { Object objectStyle = StyleFamilies.getByName(impFamilyName); - XNameContainer StyleFamilyName = (XNameContainer) - UnoRuntime.queryInterface - (XNameContainer.class, objectStyle); + XNameContainer StyleFamilyName = UnoRuntime.queryInterface + (XNameContainer.class, objectStyle); boolean hasStyle = StyleFamilyName.hasByName(impStyleName); logF.println("Does style with name '" + impStyleName diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java index 70835e11bf40..115ed47238b0 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java @@ -155,8 +155,7 @@ public class XMLImporter extends TestCase { //get draw pages XDrawPagesSupplier drawPagesSupplier = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); XDrawPages drawPages = drawPagesSupplier.getDrawPages(); - final XNameAccess xNamePages = (XNameAccess) - UnoRuntime.queryInterface(XNameAccess.class, drawPages); + final XNameAccess xNamePages = UnoRuntime.queryInterface(XNameAccess.class, drawPages); tEnv.addObjRelation("XDocumentHandler.ImportChecker", new ifc.xml.sax._XDocumentHandler.ImportChecker() { diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java index 569a91dfaee4..2829fdfee796 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java @@ -131,7 +131,7 @@ public class XMLMetaExporter extends TestCase { //change title name XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xImpressDoc) ; - XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; docInfo.setPropertyValue("Title", NAME); diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java index 8330a9396847..4c725fab6164 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java @@ -153,7 +153,7 @@ public class XMLMetaImporter extends TestCase { XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xImpressDoc) ; - final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + final XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; final PrintWriter logF = log ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java index 21d4493480f6..424460e5398e 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java @@ -128,8 +128,7 @@ public class XMLSettingsExporter extends TestCase { //set some settings XModel xImpressModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XController xController = xImpressModel.getCurrentController(); - XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); NewDataValue = ! ((Boolean) xPropSet.getPropertyValue ("IsLayerMode")).booleanValue(); xPropSet.setPropertyValue("IsLayerMode", diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java index 95707e671239..75b306624f92 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java @@ -165,8 +165,7 @@ public class XMLSettingsImporter extends TestCase { // get property before import XModel xImpressModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XController xController = xImpressModel.getCurrentController(); - final XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + final XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); try { log.println("Property \"IsLayerMode\" before import is " + xPropSet.getPropertyValue("IsLayerMode")); diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java index 8affc0d2ae4d..8a11242abace 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java @@ -141,13 +141,11 @@ public class XMLStylesExporter extends TestCase { (XStyleFamiliesSupplier.class, xImpressDoc) ; XNameAccess styleFamilies = styleSup.getStyleFamilies(); String[] styleFamiliesNames = styleFamilies.getElementNames(); - XNameContainer StyleFamilyName = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, - styleFamilies.getByName(styleFamiliesNames[0])); + XNameContainer StyleFamilyName = UnoRuntime.queryInterface(XNameContainer.class, + styleFamilies.getByName(styleFamiliesNames[0])); Object SC = SOF.createInstance (xImpressDoc, "com.sun.star.style.Style"); - XStyle StylePage = (XStyle) - UnoRuntime.queryInterface(XStyle.class,SC); + XStyle StylePage = UnoRuntime.queryInterface(XStyle.class,SC); StyleFamilyName.insertByName(newName, StylePage); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java index c96ba75498d0..5a4aa2ca795f 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java @@ -161,7 +161,7 @@ public class XMLStylesImporter extends TestCase { xImpressDoc); XNameAccess oStyleFamilies = sup.getStyleFamilies(); Object family = oStyleFamilies.getByName("graphics") ; - styles = (XNameAccess) UnoRuntime.queryInterface + styles = UnoRuntime.queryInterface (XNameAccess.class, family) ; log.println("Styles before:") ; String[] names = styles.getElementNames() ; |