INTEGRATION: CWS uaa06 (1.5.20); FILE MERGED

2008/05/08 12:39:09 obr 1.5.20.1: #i87426# repaired broken a11y hierarchy of a number of dialogs
This commit is contained in:
Oliver Bolte 2008-05-30 07:55:54 +00:00
parent 3bd450291f
commit f68c66feb6

View file

@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite * OpenOffice.org - a multi-platform office productivity suite
* *
* $RCSfile: atkfactory.cxx,v $ * $RCSfile: atkfactory.cxx,v $
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* This file is part of OpenOffice.org. * This file is part of OpenOffice.org.
* *
@ -113,9 +113,9 @@ wrapper_factory_get_accessible_type(void)
} }
static AtkObject* static AtkObject*
wrapper_factory_create_accessible( GObject *pObj ) wrapper_factory_create_accessible( GObject *obj )
{ {
GtkWidget* parent_widget = gtk_widget_get_parent( GTK_WIDGET( pObj ) ); GtkWidget* parent_widget = gtk_widget_get_parent( GTK_WIDGET( obj ) );
// gail_container_real_remove_gtk tries to re-instanciate an accessible // gail_container_real_remove_gtk tries to re-instanciate an accessible
// for a widget that is about to vanish .. // for a widget that is about to vanish ..
@ -125,27 +125,18 @@ wrapper_factory_create_accessible( GObject *pObj )
GtkSalFrame* pFrame = GtkSalFrame::getFromWindow( GTK_WINDOW( parent_widget ) ); GtkSalFrame* pFrame = GtkSalFrame::getFromWindow( GTK_WINDOW( parent_widget ) );
g_return_val_if_fail( pFrame != NULL, NULL ); g_return_val_if_fail( pFrame != NULL, NULL );
/* HACK: if the parent gtk window has an accessible already assigned, use
* this one to avoid endless recursion (see atkwindow.cxx).
*/
AtkObject* parent_accessible = (AtkObject *) g_object_get_data(G_OBJECT( parent_widget ),
"ooo:tooltip-accessible");
if( ! parent_accessible )
parent_accessible = gtk_widget_get_accessible(parent_widget);
Window* pFrameWindow = pFrame->GetWindow(); Window* pFrameWindow = pFrame->GetWindow();
if( pFrameWindow ) if( pFrameWindow )
{ {
/* as we got the frame object from the gtk parent, the corresponding Window* pWindow = pFrameWindow;
* accessible is always the (only) child of the window associated
* with the frame. // skip accessible objects already exposed by the frame objects
*/ if( WINDOW_BORDERWINDOW == pWindow->GetType() )
pWindow = pFrameWindow->GetAccessibleChildWindow(0);
Window* pWindow = pFrameWindow->GetAccessibleChildWindow(0);
if( pWindow ) if( pWindow )
{ {
uno::Reference< accessibility::XAccessible > xAccessible(pWindow->GetAccessible(true)); uno::Reference< accessibility::XAccessible > xAccessible = pWindow->GetAccessible(true);
if( xAccessible.is() ) if( xAccessible.is() )
{ {
AtkObject *accessible = ooo_wrapper_registry_get( xAccessible ); AtkObject *accessible = ooo_wrapper_registry_get( xAccessible );
@ -153,7 +144,7 @@ wrapper_factory_create_accessible( GObject *pObj )
if( accessible ) if( accessible )
g_object_ref( G_OBJECT(accessible) ); g_object_ref( G_OBJECT(accessible) );
else else
accessible = atk_object_wrapper_new( xAccessible, parent_accessible ); accessible = atk_object_wrapper_new( xAccessible, gtk_widget_get_accessible(parent_widget) );
return accessible; return accessible;
} }