To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=105351 Issue #|105351 Summary|Problem getting 'AccessibleEditableTextPara' in drawin |g shapes Component|Word processor Version|OOO310m9 Platform|PC URL| OS/Version|Windows XP Status|UNCONFIRMED Status whiteboard| Keywords| Resolution| Issue type|DEFECT Priority|P3 Subcomponent|programming Assigned to|writerneedsconfirm Reported by|yajva
------- Additional comments from [email protected] Fri Sep 25 09:52:04 +0000 2009 ------- I am trying to access the 'AccessibleEditableTextPara' of a writer document irrespective of the cursor position with the code below. Assign the macro 'Tester2' to any short cut key (I use ctrl-6). Open a new writer doc, enable the 'drawing toolbar', select 'Text' tool, draw out a rectangle, and press ctrl-6, close xray window till you get AccessibleShape. 1. On getting the AC of AccessibleShape', the xray reads the accessibility role as 33 (= com.sun.star.accessibility.AccessibleRole.LIST_ITEM), while it actually should be 55 (=com.sun.star.accessibility.AccessibleRole.SHAPE) This is pretty much true for all graphic shapes. I chose 'Text' to put forth the next point easily. 2. While the cursor is visible inside the rectangle (in edit mode), the macro cannot find the 'AccessibleEditableTextPara' yet. This is true even after entering a little text. 3. Finish the macro, draw out another 'Text' rectangle, enter text, click elewhere to defocus the Text box, enter the Text box again with a double click or a key presss, run the macro and 'AccessibleEditableTextPara' is available this time around. I feel the AC should have been available in step 2 itself. This happens with call-outs, ractangles also. Basic Macro Code: Sub Tester2 Dim oACe, ret BasicLibraries.loadLibrary("XrayTool") ret = GetWrACe(oACe) 'xray oACe msgbox ret End Sub Function GetWrACe(oACe) As Boolean Dim oACThis, oAC_SP, oAC_TDV, oAC, oACc, i, j oACThis = ThisComponent.CurrentController.Frame.ComponentWindow.AccessibleContext oAC_SP = SearchOneSecForChild1(oACThis, "", "", com.sun.star.accessibility.AccessibleRole.SCROLL_PANE, "") oAC_TDV = SearchOneSecForChild1(oAC_SP(0), "", "", -1, "com.sun.star.text.AccessibleTextDocumentView") GetWrACe = DescendTillCursor(oAC_TDV, oACe) End Function Function DescendTillCursor(oACRoot(), oACe) Dim i, oACc DescendTillCursor = False For i = 0 to ubound(oACRoot) xray oACRoot(i) Select Case oACroot(i).AccessibleRole Case com.sun.star.accessibility.AccessibleRole.PARAGRAPH : If oACroot(i).getCaretPosition <> -1 Then DescendTillCursor = True oACe = oACroot(i) Exit Function Endif Case else : oACc = SearchOneSecForChild1(oACRoot(i), "", "", -1, "") If DescendTillCursor(oACc, oACe) Then DescendTillCursor = True Exit Function Endif End Select Next i End Function --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
