Kaydet (Commit) 3e5a3ce0 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Maybe this helps TB56?

Change-Id: I209fcc9277d8efe27608b7e858f16fa31a6973b2
üst d081dda4
......@@ -169,10 +169,25 @@ public class AccessibleRelationSet {
XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc);
XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel);
XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
XAccessibleContext ctx = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT_TEXT);
XAccessibleContext ctx;
for (int i = 0;; ++i) {
XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel);
XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
ctx = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT_TEXT);
if (ctx != null) {
break;
}
if (i == 20) { // give up after 10 sec
throw new RuntimeException(
"Couldn't get AccessibleRole.DOCUMENT_TEXT object");
}
System.out.println("No DOCUMENT_TEXT found yet, retrying");
try {
Thread.sleep(500);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
para1 = ctx.getAccessibleChild(0);
para2 = ctx.getAccessibleChild(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment