Kaydet (Commit) 441cb7b7 authored tarafından Stephan Wunderlich's avatar Stephan Wunderlich

CHG: using AnyConverter instead of simple cast

üst f74c7f4b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* *
* $RCSfile: ScAccessibleDocumentPagePreview.java,v $ * $RCSfile: ScAccessibleDocumentPagePreview.java,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: sw $ * last change: $Author: sw $
* *
...@@ -91,6 +91,8 @@ import lib.TestParameters; ...@@ -91,6 +91,8 @@ import lib.TestParameters;
import util.AccessibilityTools; import util.AccessibilityTools;
import util.SOfficeFactory; import util.SOfficeFactory;
import util.utils; import util.utils;
import com.sun.star.uno.Type;
import com.sun.star.uno.AnyConverter;
/** /**
* Test for object which is represented by accessible component of * Test for object which is represented by accessible component of
...@@ -134,14 +136,30 @@ public class ScAccessibleDocumentPagePreview extends TestCase { ...@@ -134,14 +136,30 @@ public class ScAccessibleDocumentPagePreview extends TestCase {
XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ; XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
XIndexAccess oIndexSheets = (XIndexAccess) XIndexAccess oIndexSheets = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, oSheets); UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
XSpreadsheet oSheet = (XSpreadsheet) oIndexSheets.getByIndex(1); XSpreadsheet oSheet = null;
try {
oSheet = (XSpreadsheet) AnyConverter.toObject(
new Type(XSpreadsheet.class),oIndexSheets.getByIndex(1));
} catch (com.sun.star.lang.IllegalArgumentException iae) {
throw new StatusException("couldn't get sheet",iae);
}
xCell = oSheet.getCellByPosition(0, 0) ; xCell = oSheet.getCellByPosition(0, 0) ;
xCell.setFormula("ScAccessibleDocumentPagePreview - Page 2"); xCell.setFormula("ScAccessibleDocumentPagePreview - Page 2");
oSheet = (XSpreadsheet) oIndexSheets.getByIndex(2); try {
oSheet = (XSpreadsheet) AnyConverter.toObject(
new Type(XSpreadsheet.class),oIndexSheets.getByIndex(2));
} catch (com.sun.star.lang.IllegalArgumentException iae) {
throw new StatusException("couldn't get sheet",iae);
}
xCell = oSheet.getCellByPosition(0, 0) ; xCell = oSheet.getCellByPosition(0, 0) ;
xCell.setFormula("ScAccessibleDocumentPagePreview - Page 3"); xCell.setFormula("ScAccessibleDocumentPagePreview - Page 3");
oSheet = (XSpreadsheet) oIndexSheets.getByIndex(0); try {
oSheet = (XSpreadsheet) AnyConverter.toObject(
new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
} catch (com.sun.star.lang.IllegalArgumentException iae) {
throw new StatusException("couldn't get sheet",iae);
}
xCell = oSheet.getCellByPosition(0, 0) ; xCell = oSheet.getCellByPosition(0, 0) ;
xCell.setFormula("ScAccessibleDocumentPagePreview"); xCell.setFormula("ScAccessibleDocumentPagePreview");
} catch(com.sun.star.lang.WrappedTargetException e) { } catch(com.sun.star.lang.WrappedTargetException e) {
...@@ -218,7 +236,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { ...@@ -218,7 +236,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase {
(xRoot, AccessibleRole.DOCUMENT, ""); (xRoot, AccessibleRole.DOCUMENT, "");
log.println("ImplementationName " + utils.getImplName(oObj)); log.println("ImplementationName " + utils.getImplName(oObj));
at.printAccessibleTree(log, xRoot); //at.printAccessibleTree(log, xRoot);
TestEnvironment tEnv = new TestEnvironment(oObj); TestEnvironment tEnv = new TestEnvironment(oObj);
......
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