summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-27 15:40:17 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-29 22:03:01 +0200
commitb65017a2a7af290f6681da7b197a52efe83d5185 (patch)
tree06f71a435ba200d044109469b13be7c8f5dbe950 /qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java
parent33ec740d1438c3dddf8e1974757ed05bb76425ca (diff)
Java5 update - usage generics where possible
Change-Id: I12f8c448961919e153047e28fee2a0acf3af1002
Diffstat (limited to 'qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java')
-rw-r--r--qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java32
1 files changed, 11 insertions, 21 deletions
diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java
index 878cd4894955..eee7fd14cc05 100644
--- a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java
+++ b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java
@@ -150,11 +150,9 @@ public class DrawController_DrawView 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 {
@@ -173,8 +171,7 @@ public class DrawController_DrawView 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(
@@ -186,16 +183,14 @@ public class DrawController_DrawView extends TestCase {
oShapes.add(shape3);
shortWait();
- XModel aModel = (XModel)
- UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+ XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc);
XInterface oObj = aModel.getCurrentController();
- XModel aModel2 = (XModel)
- UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+ XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
XController aController2 = aModel2.getCurrentController();
- XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
+ XWindow anotherWindow = UnoRuntime.queryInterface(
XWindow.class, aController2);
log.println( "creating a new environment for impress view object" );
@@ -217,10 +212,8 @@ public class DrawController_DrawView 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);
@@ -231,10 +224,8 @@ public class DrawController_DrawView 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;
@@ -270,8 +261,7 @@ public class DrawController_DrawView 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);