diff options
author | sb <sb@openoffice.org> | 2010-03-03 15:47:51 +0100 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-03-03 15:47:51 +0100 |
commit | 09f3708149c6618c55d7dfb165fce2164fb01783 (patch) | |
tree | da6cc4267600a35075e48c55635d1fdbc4aa2f28 /qadevOOo/tests/java | |
parent | ffb8e5cf09a6b3ee34a6deee5880d9c968c83396 (diff) |
sb118: further qadevOOo fixes
Diffstat (limited to 'qadevOOo/tests/java')
-rwxr-xr-x | qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java | 23 | ||||
-rw-r--r-- | qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java | 26 |
2 files changed, 18 insertions, 31 deletions
diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java index c4a81bb06d8d..7b30a94b3293 100755 --- a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java +++ b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java @@ -70,18 +70,21 @@ public class ModuleUIConfigurationManager extends TestCase { */ protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xTextDoc "); - - try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( - XCloseable.class, xTextDoc); - closer.close(true); - } catch (com.sun.star.util.CloseVetoException e) { - log.println("couldn't close document"); - } catch (com.sun.star.lang.DisposedException e) { - log.println("couldn't close document"); + if (xTextDoc != null) { + try { + XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable.class, xTextDoc); + closer.close(true); + } catch (com.sun.star.util.CloseVetoException e) { + log.println("couldn't close document"); + } catch (com.sun.star.lang.DisposedException e) { + log.println("couldn't close document"); + } } log.println(" disposing storage"); - xStore.dispose(); + if (xStore != null) { + xStore.dispose(); + } } /** diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java index 3243ec48e3c5..be510ff1f98c 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java @@ -47,7 +47,6 @@ import com.sun.star.drawing.XDrawPagesSupplier; import com.sun.star.drawing.XShape; import com.sun.star.drawing.XShapes; import com.sun.star.frame.XController; -import com.sun.star.frame.XDesktop; import com.sun.star.frame.XFrame; import com.sun.star.frame.XModel; import com.sun.star.lang.XComponent; @@ -87,23 +86,10 @@ import com.sun.star.util.XModifiable; * @see ifc.drawing._XDrawView */ public class DrawController_DrawView extends TestCase { - static XDesktop the_Desk; static XComponent xDrawDoc; static XComponent xSecondDrawDoc; /** - * Creates the instance of the service - * <code>com.sun.star.frame.Desktop</code>. - * @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()) ); - } - - /** * Called while disposing a <code>TestEnvironment</code>. * Disposes Impress documents. * @param tParam test parameters @@ -216,9 +202,10 @@ public class DrawController_DrawView extends TestCase { XModel aModel2 = (XModel) UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XController aController2 = aModel2.getCurrentController(); XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( - XWindow.class,aModel2.getCurrentController()); + XWindow.class, aController2); log.println( "creating a new environment for impress view object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); @@ -276,16 +263,13 @@ public class DrawController_DrawView extends TestCase { tEnv.addObjRelation("XUserInputInterception.XModel", aModel); - XFrame the_frame = the_Desk.getCurrentFrame(); + XFrame the_frame = aController2.getFrame(); tEnv.addObjRelation("Frame", the_frame); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); //Adding ObjRelations for XController - tEnv.addObjRelation("SecondModel", aModel); + tEnv.addObjRelation("SecondModel", aModel2); - XController secondController = aModel.getCurrentController(); - tEnv.addObjRelation("SecondController", secondController); + tEnv.addObjRelation("SecondController", aController2); tEnv.addObjRelation("XDispatchProvider.URL", "slot:27009"); |