diff options
Diffstat (limited to 'qadevOOo/tests/java/mod/_sd/SdUnoPresView.java')
-rw-r--r-- | qadevOOo/tests/java/mod/_sd/SdUnoPresView.java | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java index 6352a44c8d2f..80e1afefd65f 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java @@ -86,10 +86,9 @@ public class SdUnoPresView extends TestCase { * @see com.sun.star.frame.Desktop */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) - UnoRuntime.queryInterface( - XDesktop.class, DesktopTools.createDesktop( - (XMultiServiceFactory)Param.getMSF()) ); + the_Desk = UnoRuntime.queryInterface( + XDesktop.class, DesktopTools.createDesktop( + (XMultiServiceFactory)Param.getMSF()) ); } /** @@ -160,11 +159,9 @@ public class SdUnoPresView extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); XDrawPages the_pages = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,the_pages); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,the_pages); XDrawPage oDrawPage = null; XDrawPage secondDrawPage = null; @@ -190,27 +187,23 @@ public class SdUnoPresView extends TestCase { //put something on the drawpage log.println( "inserting some Shapes" ); - XShapes oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oDrawPage); + XShapes oShapes = UnoRuntime.queryInterface(XShapes.class, oDrawPage); XShape shape1 = SOF.createShape( xImpressDoc, 5000, 3500, 7500, 5000, "Rectangle"); oShapes.add(shape1); - oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, secondDrawPage); + oShapes = UnoRuntime.queryInterface(XShapes.class, secondDrawPage); shape1 = SOF.createShape( xImpressDoc, 3000, 4500, 15000, 1000, "Ellipse"); oShapes.add(shape1); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xImpressDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XInterface oObj = aModel.getCurrentController(); - XModel aModel2 = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); - XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( + XWindow anotherWindow = UnoRuntime.queryInterface( XWindow.class,aModel2.getCurrentController()); log.println( "creating a new environment for impress view object" ); @@ -225,10 +218,8 @@ public class SdUnoPresView extends TestCase { tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XIndexAccess indAc1 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o1); - XIndexAccess indAc2 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o2); + XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); + XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); if (indAc1 == null || indAc2 == null) return -1; if (indAc1.getCount() == indAc2.getCount()) { return 0; @@ -255,8 +246,7 @@ public class SdUnoPresView extends TestCase { XFrame the_frame = the_Desk.getCurrentFrame(); tEnv.addObjRelation("Frame", the_frame); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); //Adding ObjRelations for XController tEnv.addObjRelation("SecondModel", aModel); @@ -267,8 +257,7 @@ public class SdUnoPresView extends TestCase { log.println("Implementation Name: "+utils.getImplName(oObj)); - XModifiable modify = (XModifiable) - UnoRuntime.queryInterface(XModifiable.class,xImpressDoc); + XModifiable modify = UnoRuntime.queryInterface(XModifiable.class,xImpressDoc); tEnv.addObjRelation("Modifiable",modify); |