}
public void prepareToSort() {
oTable.getCellByName("A1").setValue(4);
XTextRange textRange = (XTextRange) UnoRuntime.queryInterface(
XTextRange.class,
oTable.getCellByName("A2"));
textRange.setString("b");
oTable.getCellByName("A3").setValue(3);
textRange = (XTextRange) UnoRuntime.queryInterface(
XTextRange.class,
oTable.getCellByName("A4"));
textRange.setString("a");
oTable.getCellByName("A5").setValue(23);
textRange = (XTextRange) UnoRuntime.queryInterface(
XTextRange.class,
oTable.getCellByName("A6"));
textRange.setString("ab");
}
public boolean checkSort(boolean isSortNumbering,
boolean isSortAscending) {
out.println("Sort checking...");
boolean res = false;
String[] value = new String[6];
for (int i = 0; i < 6; i++) {
XCell cell = oTable.getCellByName("A" + (i + 1));
XTextRange textRange = (XTextRange) UnoRuntime.queryInterface(
XTextRange.class, cell);
value[i] = textRange.getString();
}
if (isSortNumbering) {
if (isSortAscending) {
String[] rightVal = { "3", "4", "23" };