summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java
diff options
context:
space:
mode:
authorStephan Wunderlich <sw@openoffice.org>2003-02-03 12:35:34 +0000
committerStephan Wunderlich <sw@openoffice.org>2003-02-03 12:35:34 +0000
commit73ddcdc680e269b1e372d5002e2409fd5feedebc (patch)
treec07f5d71db4366db8daebd827efd6289767a6f42 /qadevOOo/tests/java
parent0105ee238374d2d4352deff33c23f69364a42e2e (diff)
CHG: using AnyConverter instead of simple cast
Diffstat (limited to 'qadevOOo/tests/java')
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java13
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java10
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java15
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java13
4 files changed, 38 insertions, 13 deletions
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java
index 18b2768cbd8c..186ec02c365f 100644
--- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java
@@ -2,9 +2,9 @@
*
* $RCSfile: ScIndexEnumeration_ScenariosEnumeration.java,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change:$Date: 2003-01-27 18:16:24 $
+ * last change:$Date: 2003-02-03 13:27:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,6 +80,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_ScenariosEnumeration extends TestCase {
public XSpreadsheetDocument xSpreadsheetDoc;
@@ -118,13 +121,17 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase {
XIndexAccess oIndexAccess = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
try {
- oSheet = (XSpreadsheet)oIndexAccess.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);
}
log.println("filling some cells");
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java
index 246690960b7f..9c6152f5ed99 100644
--- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java
@@ -2,9 +2,9 @@
*
* $RCSfile: ScIndexEnumeration_SheetCellRangesEnumeration.java,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change:$Date: 2003-01-27 18:16:23 $
+ * last change:$Date: 2003-02-03 13:30:33 $
*
* 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_SheetCellRangesEnumeration extends TestCase {
XSpreadsheetDocument xSheetDoc = null;
@@ -134,7 +137,8 @@ public class ScIndexEnumeration_SheetCellRangesEnumeration extends TestCase {
UnoRuntime.queryInterface (XIndexAccess.class, oSheets);
XSpreadsheet oSheet = null;
try {
- oSheet = (XSpreadsheet) oIndSheets.getByIndex(0);
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndSheets.getByIndex(0));
XNameContainer oRanges = (XNameContainer)
UnoRuntime.queryInterface(XNameContainer.class, oObj);
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)
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java
index 6bc034aa7b46..56d80ffaf6d3 100644
--- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java
@@ -2,9 +2,9 @@
*
* $RCSfile: ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change:$Date: 2003-01-27 18:16:22 $
+ * last change:$Date: 2003-02-03 13:35:34 $
*
* 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_SpreadsheetViewPanesEnumeration extends TestCase {
private XSpreadsheetDocument xSpreadsheetDoc;
private SOfficeFactory SOF;
@@ -117,13 +120,17 @@ public class ScIndexEnumeration_SpreadsheetViewPanesEnumeration extends TestCase
XIndexAccess xIA = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, xc);
try {
- oObj = (XInterface)xIA.getByIndex(0);
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xIA.getByIndex(0));
} catch (com.sun.star.lang.WrappedTargetException e) {
e.printStackTrace(log);
throw new StatusException("Couldn't get by index", e);
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
e.printStackTrace(log);
throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
}
XEnumerationAccess ea = (XEnumerationAccess)