Kaydet (Commit) 4c6f4ff6 authored tarafından Stephan Wunderlich's avatar Stephan Wunderlich

CHG: using AnyConverter instead of simple cast

üst d95c5e7c
......@@ -2,9 +2,9 @@
*
* $RCSfile: ScDataPilotTablesObj.java,v $
*
* $Revision: 1.1 $
* $Revision: 1.2 $
*
* last change:$Date: 2003-01-27 18:16:31 $
* last change:$Date: 2003-02-03 11:01:56 $
*
* 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;
/**
* Test for object which is represented by service
* <code>com.sun.star.sheet.DataPilotTables</code>. <p>
......@@ -145,8 +148,7 @@ public class ScDataPilotTablesObj extends TestCase {
* @see com.sun.star.sheet.DataPilotTable
* @see com.sun.star.sheet.XDataPilotTablesSupplier
*/
public synchronized TestEnvironment createTestEnvironment(
TestParameters Param, PrintWriter log) throws StatusException {
protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
Object oInterface = null;
XInterface oObj = null;
......@@ -165,15 +167,20 @@ public class ScDataPilotTablesObj 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);
}
try {
log.println("Filing a table");
for (int i = 1; i < 4; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment