requiredMethod("getSubTotalDescriptor()");
requiredMethod("setDataArea()");
for(int i = STARTROW; i < ENDROW+1; i++) {
try {
XCell cell = xCellRange.getCellByPosition(COL, i);
cell.setValue(i);
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
log.println("Unexpected exception");
e.printStackTrace(log);
tRes.tested("refresh()", false);
}
}
SubTotalColumn[] STC = new SubTotalColumn[1];
STC[0] = new SubTotalColumn();
STC[0].Column = COL;
STC[0].Function = com.sun.star.sheet.GeneralFunction.SUM;
double oldVal = 0;
try {
XCell checkCell = xCellRange.getCellByPosition(COL, ENDROW);
oldVal = checkCell.getValue();
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
log.println("Unexpected exception");
e.printStackTrace(log);
tRes.tested("refresh()", false);
}
log.println("Value of the cell (" + COL + ", " + ENDROW +
") : " + oldVal );
log.println("Set new SubTotal descriptor...");
STD.clear();
STD.addNew(STC, 1);
double valBeforeRefresh = 0;
try {
XCell checkCell = xCellRange.getCellByPosition(COL, ENDROW);
valBeforeRefresh = checkCell.getValue();
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
log.println("Unexpected exception");
e.printStackTrace(log);
tRes.tested("refresh()", false);
}
log.println("Value of the cell (" + COL + ", " + ENDROW +
") : " + valBeforeRefresh );
log.println("Now call refresh()...");
oObj.refresh();
double valAfterRefresh = 0;
try {
XCell checkCell = xCellRange.getCellByPosition(COL, ENDROW);
valAfterRefresh = checkCell.getValue();
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
log.println("Unexpected exception");
e.printStackTrace(log);
tRes.tested("refresh()", false);
}