*/
public ITextRange[] getTextRanges() {
if (xInterface != null) {
XTextRange textRange = (XTextRange) UnoRuntime.queryInterface(
XTextRange.class, xInterface);
return new ITextRange[] { new TextRange(document, textRange) };
} else {
List list = new ArrayList();
for (int i = 0, n = xIndexAccess.getCount(); i < n; i++) {
try {
Any any = (Any) xIndexAccess.getByIndex(i);
XTextRange textRange = (XTextRange) UnoRuntime
.queryInterface(XTextRange.class, any);
if (textRange != null)
list.add(new TextRange(document, textRange));
} catch (Throwable throwable) {
// do not consume
}
}
return (ITextRange[]) list.toArray(new ITextRange[list.size()]);