To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=99848
                 Issue #|99848
                 Summary|OO crash on accessing "Font name" accessibile context
               Component|Word processor
                 Version|OOO300m9
                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 ya...@openoffice.org Wed Mar  4 08:10:11 +0000 
2009 -------
I am trying to get accessible context of 'Font name' combo in OO 'writer' from a
macro. The moment the accessibility context is referenced, the combo turns gray
(disabled). Choosing a different apply style enables the combo. However,
changing font from the 'font name' combo crashes OO. 

Condition is perfectly repeatable.

The code is given below.

Happens with any writer doc open (even untitled).

REM  *****  BASIC  *****
option explicit

Sub   M7_SetupWinLinks

   dim      oDocWin, oAC, oACFontCbox

   oDocWin =
M7_GetWindowOpen(com.sun.star.accessibility.AccessibleRole.ROOT_PANE,
ThisComponent.Title, oAC)

'EXECUTING THE FOLLOWING LINE CAUSES COMBO TO GRAY OUT
   oACFontCbox =
oDocWin.AccessibleContext.getAccessibleChild(1).AccessibleContext.getAccessibleChild(1).AccessibleContext.getAccessibleChild(4).AccessibleContext.getAccessibleChild(0).AccessibleContext
End Sub




Function M7_GetWindowOpen(role, sTitle as String, oACofWin) As Object
  Dim oToolkit
  Dim lCount As Long
  Dim k As Long
  Dim oWin
  Dim   oAC, tmp

'  oToolkit = Stardesktop.ActiveFrame.ContainerWindow.Toolkit
   oToolkit = ThisComponent.CurrentController.Frame.ContainerWindow.Toolkit
  lCount = oToolkit.TopWindowCount

   ON  local ERROR GOTO TooBad

  For k= 0 To lCount -1
    oWin = oToolkit.getTopWindow(k)
    If HasUnoInterfaces(oWin, "com.sun.star.accessibility.XAccessibleContext") 
Then
      oAC = oWin
   ElseIf HasUnoInterfaces(oWin, "com.sun.star.accessibility.XAccessible") Then
      oAC = oWin.AccessibleContext
   Else
      goto here
   End If

'   If oAC.getAccessibleRole() =
com.sun.star.accessibility.AccessibleRole.DIALOG  and oAC.getAccessibleName() =
"Find & Replace" Then
'tmp = oAC.getAccessibleName()
'msgbox tmp
      If (oAC.getAccessibleRole() = role) and (left(oAC.getAccessibleName(),
len(sTitle)) = sTitle) Then
         M7_GetWindowOpen = oWin
         oACofWin = oAC
         Exit Function
       EndIf
here:
  Next k

TooBad:
if err <>  0 then
goto again
again:
   ON  ERROR GOTO TooBad
goto here
end if

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: issues-unsubscr...@sw.openoffice.org
For additional commands, e-mail: issues-h...@sw.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to