diff options
Diffstat (limited to 'qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java')
-rw-r--r-- | qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java index 44af97713ce0..7595155fafa4 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java @@ -89,10 +89,9 @@ public class DrawController_OutlineView 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()) ); } /** @@ -166,11 +165,9 @@ public class DrawController_OutlineView extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); 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; try { @@ -189,8 +186,7 @@ public class DrawController_OutlineView 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( xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"); XShape shape2 = SOF.createShape( @@ -212,18 +208,16 @@ public class DrawController_OutlineView extends TestCase { utils.shortWait(500); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XInterface oObj = aModel.getCurrentController(); log.println("bring first document to front..."); DesktopTools.bringWindowToFront(aModel); - 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" ); @@ -245,10 +239,8 @@ public class DrawController_OutlineView extends TestCase { throw new StatusException(Status.failed("Couldn't create instance")); } - XShapes xShapes1 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol1); - XShapes xShapes2 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol2); + XShapes xShapes1 = UnoRuntime.queryInterface(XShapes.class, oShapeCol1); + XShapes xShapes2 = UnoRuntime.queryInterface(XShapes.class, oShapeCol2); xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); @@ -258,10 +250,8 @@ public class DrawController_OutlineView extends TestCase { oDrawPage, oShapeCol1, oShapeCol2}); 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; @@ -284,8 +274,7 @@ public class DrawController_OutlineView 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); @@ -300,8 +289,7 @@ public class DrawController_OutlineView extends TestCase { log.println("Implementation Name: "+utils.getImplName(oObj)); - XModifiable modify = (XModifiable) - UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); + XModifiable modify = UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); tEnv.addObjRelation("Modifiable",modify); |