diff options
author | Stephan Wunderlich <sw@openoffice.org> | 2003-02-03 12:35:34 +0000 |
---|---|---|
committer | Stephan Wunderlich <sw@openoffice.org> | 2003-02-03 12:35:34 +0000 |
commit | 73ddcdc680e269b1e372d5002e2409fd5feedebc (patch) | |
tree | c07f5d71db4366db8daebd827efd6289767a6f42 /qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java | |
parent | CHG: using AnyConverter instead of simple cast (diff) | |
download | core-73ddcdc680e269b1e372d5002e2409fd5feedebc.tar.gz core-73ddcdc680e269b1e372d5002e2409fd5feedebc.zip |
CHG: using AnyConverter instead of simple cast
Diffstat (limited to 'qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java')
-rw-r--r-- | qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java index fc63436ca344..fb3e73bdbe34 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java @@ -2,9 +2,9 @@ * * $RCSfile: ScIndexEnumeration_SheetLinksEnumeration.java,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change:$Date: 2003-01-27 18:16:23 $ + * last change:$Date: 2003-02-03 13:32:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,6 +78,9 @@ import lib.TestEnvironment; import lib.TestParameters; import util.SOfficeFactory; +import com.sun.star.uno.AnyConverter; +import com.sun.star.uno.Type; + public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { XSpreadsheetDocument xSheetDoc = null; @@ -119,16 +122,20 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { log.println("Getting test object ") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) + XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, oSheets); try { - oSheet = (XSpreadsheet) oIndexSheets.getByIndex(0); + oSheet = (XSpreadsheet) AnyConverter.toObject( + new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); throw new StatusException( "Couldn't get a spreadsheet", e); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { e.printStackTrace(log); throw new StatusException( "Couldn't get a spreadsheet", e); + } catch (com.sun.star.lang.IllegalArgumentException e) { + e.printStackTrace(log); + throw new StatusException( "Couldn't get a spreadsheet", e); } XSheetLinkable SL = (XSheetLinkable) |