* @see com.sun.star.sheet.SheetFilterDescriptor
*/
protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
XInterface oObj = null;
XSheetFilterable SF = null;
log.println("getting sheets");
XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
log.println("getting a sheet");
XSpreadsheet oSheet = null;
XIndexAccess oIndexAccess = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
try {
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");
try {
oSheet.getCellByPosition(5, 5).setValue(15);
oSheet.getCellByPosition(1, 4).setValue(10);
oSheet.getCellByPosition(2, 0).setValue(-5.15);
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
e.printStackTrace(log);
throw new StatusException(
"Exception occurred while filling cells", e);
}
SF = (XSheetFilterable)
UnoRuntime.queryInterface(XSheetFilterable.class, oSheet);
oObj = SF.createFilterDescriptor(true);
log.println("creating a new environment for object");
TestEnvironment tEnv = new TestEnvironment(oObj);
return tEnv;