public boolean _getTextBehindIndex() {
boolean res = true;
try {
log.println("getTextBehindIndex(-1, AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBehindIndex(-1,
AccessibleTextType.PARAGRAPH);
log.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
log.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
log.println("Expected exception");
res &= true;
}
try {
log.println("getTextBehindIndex(chCount+1, " +
"AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBehindIndex(chCount + 1,
AccessibleTextType.PARAGRAPH);
log.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
log.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
log.println("Expected exception");
res &= true;
}
try {
if ( chCount > 0 ) {
log.println("getTextBehindIndex(chCount," +
" AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBehindIndex(chCount,
AccessibleTextType.PARAGRAPH);
log.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == 0;
log.println("getTextBehindIndex(chCount-1," +
" AccessibleTextType.PARAGRAPH):");
txt = oObj.getTextBehindIndex(chCount - 1,
AccessibleTextType.PARAGRAPH);
log.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == 0;
}
if ( chCount > 1 ) {
log.println("getTextBehindIndex(1," +
" AccessibleTextType.CHARACTER):");
TextSegment txt = oObj.getTextBehindIndex(1,
AccessibleTextType.CHARACTER);
log.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text.substring(2, 3));
}
if (chCount > 2) {
log.println("getTextBehindIndex(chCount-2," +
" AccessibleTextType.CHARACTER):");
TextSegment txt = oObj.getTextBehindIndex(chCount - 2,
AccessibleTextType.CHARACTER);
log.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text.substring(chCount - 1, chCount));
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {