diff options
author | Stephan Wunderlich <sw@openoffice.org> | 2003-02-06 13:33:16 +0000 |
---|---|---|
committer | Stephan Wunderlich <sw@openoffice.org> | 2003-02-06 13:33:16 +0000 |
commit | e74e3d5efe50fa8df9a1aaf37b0f686e811f614c (patch) | |
tree | 9cc5f86aaba236ad05d38fd12b64012694ac99d2 /qadevOOo/tests/java/mod/_sw/SwXStyle.java | |
parent | CHG: using AnyConverter instead of simple cast (diff) | |
download | core-e74e3d5efe50fa8df9a1aaf37b0f686e811f614c.tar.gz core-e74e3d5efe50fa8df9a1aaf37b0f686e811f614c.zip |
CHG: using AnyConverter instead of simple cast
Diffstat (limited to 'qadevOOo/tests/java/mod/_sw/SwXStyle.java')
-rw-r--r-- | qadevOOo/tests/java/mod/_sw/SwXStyle.java | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/qadevOOo/tests/java/mod/_sw/SwXStyle.java b/qadevOOo/tests/java/mod/_sw/SwXStyle.java index 15e8ad1904bf..95bc730a1f27 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXStyle.java +++ b/qadevOOo/tests/java/mod/_sw/SwXStyle.java @@ -2,9 +2,9 @@ * * $RCSfile: SwXStyle.java,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change:$Date: 2003-01-27 18:18:31 $ + * last change:$Date: 2003-02-06 14:16:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,6 +82,9 @@ import lib.TestEnvironment; import lib.TestParameters; import util.SOfficeFactory; +import com.sun.star.uno.AnyConverter; +import com.sun.star.uno.Type; + /** * Test for object which is represented by service * <code>com.sun.star.style.Style</code>. <p> @@ -165,10 +168,12 @@ public class SwXStyle extends TestCase { XNameAccess oSF = oSFS.getStyleFamilies(); XIndexAccess oSFsIA = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, oSF); - oSFNA = (XNameAccess) oSFsIA.getByIndex(0); + oSFNA = (XNameAccess) AnyConverter.toObject( + new Type(XNameAccess.class),oSFsIA.getByIndex(0)); XIndexAccess oSFIA = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); - oStyle = (XStyle) oSFIA.getByIndex(10); + oStyle = (XStyle) AnyConverter.toObject( + new Type(XStyle.class),oSFIA.getByIndex(10)); } catch ( com.sun.star.lang.WrappedTargetException e ) { log.println("Error: exception occured."); e.printStackTrace(log); @@ -177,6 +182,10 @@ public class SwXStyle extends TestCase { log.println("Error: exception occured."); e.printStackTrace(log); throw new StatusException( "Couldn't create environment ", e ); + } catch ( com.sun.star.lang.IllegalArgumentException e ) { + log.println("Error: exception occured."); + e.printStackTrace(log); + throw new StatusException( "Couldn't create environment ", e ); } try { @@ -197,7 +206,7 @@ public class SwXStyle extends TestCase { log.println("FAILED"); else log.println("OK"); - XNameContainer oSFNC = (XNameContainer) + XNameContainer oSFNC = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oSFNA); try { @@ -271,5 +280,4 @@ public class SwXStyle extends TestCase { return names; } -} // finish class SwXStyle - +} // finish class SwXStyle
\ No newline at end of file |