Object[] selections = {oSheet, cellRange, cell_1, cell_2};
tEnv.addObjRelation("Selections", selections);
tEnv.addObjRelation("Comparer", new Comparator() {
public int compare(Object o1, Object o2) {
XCellRangeAddressable adr1 = (XCellRangeAddressable)
UnoRuntime.queryInterface(XCellRangeAddressable.class, o1);
XCellRangeAddressable adr2 = (XCellRangeAddressable)
UnoRuntime.queryInterface(XCellRangeAddressable.class, o2);
if (adr1 == null || adr2 == null) return -1;
CellRangeAddress range1 = adr1.getRangeAddress();
CellRangeAddress range2 = adr2.getRangeAddress();
return ValueComparer.equalValue(range1, range2) ? 0 : 1 ;
}
public boolean equals(Object obj) {
return compare(this, obj) == 0;
} });