diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-27 16:08:28 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-29 22:03:01 +0200 |
commit | 453d7edc424d6652e209ace4915d96193a79be71 (patch) | |
tree | 0a6af928cf7d1fd90ec995ae7d114f08eaf617fd /qadevOOo/runner/util/FormTools.java | |
parent | Java5 update - usage generics where possible (diff) | |
download | core-453d7edc424d6652e209ace4915d96193a79be71.tar.gz core-453d7edc424d6652e209ace4915d96193a79be71.zip |
Java5 update - convert more code to use generics:wq
Change-Id: I7ea32cad40a6657e4e5886d04af008cb6d67ac6e
Diffstat (limited to 'qadevOOo/runner/util/FormTools.java')
-rw-r--r-- | qadevOOo/runner/util/FormTools.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/qadevOOo/runner/util/FormTools.java b/qadevOOo/runner/util/FormTools.java index 7bafd75047df..032fe7eff2b0 100644 --- a/qadevOOo/runner/util/FormTools.java +++ b/qadevOOo/runner/util/FormTools.java @@ -70,8 +70,7 @@ public class FormTools { try{ Object oInt = oDocMSF.createInstance("com.sun.star.drawing.ControlShape"); Object aCon = oDocMSF.createInstance("com.sun.star.form.component."+kind); - XPropertySet model_props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,aCon); + XPropertySet model_props = UnoRuntime.queryInterface(XPropertySet.class,aCon); model_props.setPropertyValue("DefaultControl","com.sun.star.form.control."+kind); aControl = UnoRuntime.queryInterface( XControlModel.class, aCon ); oCShape = UnoRuntime.queryInterface( XControlShape.class, oInt ); @@ -105,8 +104,7 @@ public class FormTools { try{ Object oInt = oDocMSF.createInstance("com.sun.star.drawing.ControlShape"); Object aCon = oDocMSF.createInstance("com.sun.star.form.component."+kind); - XPropertySet model_props = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,aCon); + XPropertySet model_props = UnoRuntime.queryInterface(XPropertySet.class,aCon); model_props.setPropertyValue("DefaultControl","com.sun.star.awt."+defControl); aControl = UnoRuntime.queryInterface( XControlModel.class, aCon ); oCShape = UnoRuntime.queryInterface( XControlShape.class, oInt ); @@ -198,7 +196,7 @@ public class FormTools { String aName ) { try { XInterface oControl = createControl(aDoc, "Form"); - XForm oForm = (XForm) UnoRuntime.queryInterface(XForm.class, oControl); + XForm oForm = UnoRuntime.queryInterface(XForm.class, oControl); Forms.insertByName(aName,oForm); } catch ( Exception e ) { throw new IllegalArgumentException( "Couldn't insert Form" ); @@ -225,7 +223,7 @@ public class FormTools { } catch (com.sun.star.lang.IllegalArgumentException iae) { System.out.println("### Couldn't convert Any"); } - XPropertySet formProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, the_form); + XPropertySet formProps = UnoRuntime.queryInterface(XPropertySet.class, the_form); formProps.setPropertyValue("DataSourceName","Bibliography"); formProps.setPropertyValue("Command","biblio"); formProps.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE)); @@ -254,7 +252,7 @@ public class FormTools { XForm the_form = (XForm) AnyConverter.toObject(new Type(XForm.class), FormTools.getIndexedForms(WriterTools.getDrawPage(aDoc)).getByIndex(0)); - XPropertySet formProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, the_form); + XPropertySet formProps = UnoRuntime.queryInterface(XPropertySet.class, the_form); formProps.setPropertyValue("DataSourceName",sourceName); formProps.setPropertyValue("Command",tableName); formProps.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE)); @@ -267,7 +265,7 @@ public class FormTools { try { XForm the_form = (XForm) FormTools.getForms(WriterTools.getDrawPage(aDoc)).getByName(formName); - XPropertySet formProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, the_form); + XPropertySet formProps = UnoRuntime.queryInterface(XPropertySet.class, the_form); formProps.setPropertyValue("DataSourceName","Bibliography"); formProps.setPropertyValue("Command","biblio"); formProps.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE)); @@ -297,7 +295,7 @@ public class FormTools { XForm the_form = (XForm) AnyConverter.toObject(new Type(XForm.class), FormTools.getForms(WriterTools.getDrawPage(aDoc)).getByName(formName)); - XPropertySet formProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, the_form); + XPropertySet formProps = UnoRuntime.queryInterface(XPropertySet.class, the_form); formProps.setPropertyValue("DataSourceName",sourceName); formProps.setPropertyValue("Command",tableName); formProps.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE)); @@ -322,7 +320,7 @@ public class FormTools { atrans.parseStrict(aURLA); aURL = aURLA[0]; - com.sun.star.frame.XDispatch aDisp = (com.sun.star.frame.XDispatch)aDispProv.queryDispatch(aURL, "", + com.sun.star.frame.XDispatch aDisp = aDispProv.queryDispatch(aURL, "", com.sun.star.frame.FrameSearchFlag.SELF | com.sun.star.frame.FrameSearchFlag.CHILDREN); |