}
public void _setTableOperation() {
boolean res = true;
XCellRange cellRange = oSheet.getCellRangeByName("$A$17:$A$17");
XCellRangeAddressable CRA = (XCellRangeAddressable) UnoRuntime.queryInterface(
XCellRangeAddressable.class,
cellRange);
XCell cell = null;
XCell cell2 = null;
try {
cell = oSheet.getCellByPosition(0, 16);
cell.setFormula("=a15+a16");
cell = oSheet.getCellByPosition(0, 14);
cell2 = oSheet.getCellByPosition(0, 15);
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
log.println("Exception while getting Cell " + e.getMessage());
}
XCellAddressable CA = (XCellAddressable) UnoRuntime.queryInterface(
XCellAddressable.class, cell);
XCellAddressable CA2 = (XCellAddressable) UnoRuntime.queryInterface(
XCellAddressable.class, cell2);
Point[] cellCoords = new Point[3];
double[] cellValues = new double[3];
log.println("filling cells");
fillCells();
log.println("setting TableOperation with parameter ROW");
oObj.setTableOperation(CRA.getRangeAddress(), TableOperationMode.ROW,
CA.getCellAddress(), CA2.getCellAddress());
log.println("checking values");
cellCoords = new Point[] {
new Point(1, 1), new Point(2, 1), new Point(3, 1)
};
cellValues = new double[] { 5, 10, 15 };
res &= checkValues(cellCoords, cellValues);
log.println("filling cells");
fillCells();
log.println("setting TableOperation with parameter COLUMN");
oObj.setTableOperation(CRA.getRangeAddress(),
TableOperationMode.COLUMN, CA.getCellAddress(),
CA2.getCellAddress());
log.println("checking values");
cellCoords = new Point[] {
new Point(1, 1), new Point(1, 2), new Point(1, 3)
};
cellValues = new double[] { 12, 24, 36 };
res &= checkValues(cellCoords, cellValues);
if (both) {
log.println("filling cells");
fillCells();
log.println("setting TableOperation with parameter BOTH");
oObj.setTableOperation(CRA.getRangeAddress(),
TableOperationMode.BOTH,
CA.getCellAddress(), CA2.getCellAddress());
log.println("checking values");
cellCoords = new Point[] {
new Point(1, 1), new Point(2, 2), new Point(3, 3)