From edd0ebc6c47352de490041bb05cd5875738ba902 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Aug 2009 19:55:14 +0000 Subject: Check if the FloatingWindow instance is used as a popup menu, and if yes, instantiate the accessible object from it, instead of its parent border window instance. --- accessibility/source/helper/acc_factory.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'accessibility/source/helper') diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx index ba36bef7f065..643e55f4d5c5 100644 --- a/accessibility/source/helper/acc_factory.cxx +++ b/accessibility/source/helper/acc_factory.cxx @@ -72,6 +72,7 @@ #include #include #include +#include "vcl/floatwin.hxx" #include @@ -376,18 +377,17 @@ inline bool hasFloatingChild(Window *pWindow) } else if ( nType == WINDOW_BORDERWINDOW && hasFloatingChild( pWindow ) ) { - // TODO: better way to handle this? - Window* pChild = pWindow->GetAccessibleChildWindow(0); - if ( pChild->IsMenuFloatingWindow() ) - // Menu popup window handles accessibility differently. - xContext = new FloatingWindowAccessible( _pXWindow ); - else + FloatingWindow* pChild = static_cast( + pWindow->GetAccessibleChildWindow(0)); + if ( pChild->IsPopupMenu() ) { // Get the accessible context from the child window. Reference xAccessible = pChild->CreateAccessible(); if (xAccessible.is()) xContext = xAccessible->getAccessibleContext(); } + else + xContext = new FloatingWindowAccessible( _pXWindow ); } else if ( nType == WINDOW_HELPTEXTWINDOW ) { -- cgit