diff options
author | Andre Fischer <andre.f.fischer <Andre Fischer<andre.f.fischer@oracle.com> | 2010-08-05 10:53:45 +0200 |
---|---|---|
committer | Andre Fischer <andre.f.fischer <Andre Fischer<andre.f.fischer@oracle.com> | 2010-08-05 10:53:45 +0200 |
commit | b78085151418f4cf0a643cce26701a728b2a00f0 (patch) | |
tree | 0230f6cb5c848be946c7548ef395a0fd5fc9a84c /sd | |
parent | ef05272548413db0482faf229e6f2653985001c1 (diff) |
impress197: #i112420# Create accessibility object of ToolPanelViewShell in constructor.
Diffstat (limited to 'sd')
-rwxr-xr-x | sd/source/ui/toolpanel/ToolPanelViewShell.cxx | 17 | ||||
-rwxr-xr-x | sd/source/ui/view/sdwindow.cxx | 4 |
2 files changed, 17 insertions, 4 deletions
diff --git a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx index c62faf29ca50..f193b2ece851 100755 --- a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx +++ b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx @@ -512,12 +512,20 @@ ToolPanelViewShell::ToolPanelViewShell( SfxViewFrame* pFrame, ViewShellBase& rVi SetName( String( RTL_CONSTASCII_USTRINGPARAM( "ToolPanelViewShell" ) ) ); + // Some recent changes to the toolpanel make it necessary to create the + // accessibility object now. Creating it on demand would lead to a + // pointer cycle in the tree of accessibility objects and would lead + // e.g. the accerciser AT tool into an infinite loop. + // It would be nice to get rid of this workaround in the future. + if (mpContentWindow.get()) + mpContentWindow->SetAccessible(mpImpl->CreateAccessible(*mpContentWindow)); + // For accessibility we have to shortly hide the content window. This // triggers the construction of a new accessibility object for the new // view shell. (One is created earlier while the construtor of the base // class is executed. At that time the correct accessibility object can // not be constructed.) - if ( mpContentWindow.get() ) + if (mpContentWindow.get()) { mpContentWindow->Hide(); mpContentWindow->Show(); @@ -633,7 +641,12 @@ DockingWindow* ToolPanelViewShell::GetDockingWindow() Reference< XAccessible > ToolPanelViewShell::CreateAccessibleDocumentView( ::sd::Window* i_pWindow ) { ENSURE_OR_RETURN( i_pWindow, "ToolPanelViewShell::CreateAccessibleDocumentView: illegal window!", NULL ); - return mpImpl->CreateAccessible( *i_pWindow ); + // As said above, we have to create the accessibility object + // (unconditionally) in the constructor, not here on demand, or + // otherwise we would create a cycle in the tree of accessible objects + // which could lead to infinite loops in AT tools. + // return mpImpl->CreateAccessible( *i_pWindow ); + return Reference<XAccessible>(); } // --------------------------------------------------------------------------------------------------------------------- diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 28873b3946a3..ed5dda39037c 100755 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -1165,11 +1165,11 @@ void Window::DropScroll(const Point& rMousePos) Window::CreateAccessible (void) { if (mpViewShell != NULL) - return mpViewShell->CreateAccessibleDocumentView (this); + return mpViewShell->CreateAccessibleDocumentView (this); else { OSL_TRACE ("::sd::Window::CreateAccessible: no view shell"); - return ::Window::CreateAccessible (); + return ::Window::CreateAccessible (); } } |