Max Giesbert schrieb:
Thx again. feels like i am already there. i got the XCell now from the
Target but how can i get the location of the cell on the screen. i read
about XAccessibleComponent but XCell doesn't seem to implement it...

I have written a tiny test script in Basic recently, that gets the XAccessible for the first sheet in the first open Calc document. Maybe this helps you to continue... Some ideas how to proceed: You can get the parent of the sheet, this is the container of all sheets, to be able to get the n-th sheet. From the sheet you can call getAccessibleCellAt(row,column) to access the cells. Note that the lines in the code below may be broken into several lines.



Sub Main
acc = ThisComponent.CurrentController.Frame.ComponentWindow.AccessibleContext table = GetAccessibleForRole( acc, com.sun.star.accessibility.AccessibleRole.TABLE )
        If Not IsNull( table ) Then
...
        EndIf
End Sub

Function GetAccessibleForRole( acc As Object, role As Integer ) As Object
        If IsNull( acc ) Then Exit Function

        count = acc.AccessibleChildCount
        If count = 0 Then Exit Function

        For i = 0 To count - 1
                child = acc.getAccessibleChild( i ).AccessibleContext
                If child.AccessibleRole = role Then
                        GetAccessibleForRole = child
                        Exit Function
                EndIf
        Next

        For i = 0 To count - 1
child = GetAccessibleForRole( acc.getAccessibleChild( i ).AccessibleContext, role )
                If Not IsNull( child ) Then
                        GetAccessibleForRole = child
                        Exit Function
                EndIf
        Next
End Function

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to