summaryrefslogtreecommitdiff
path: root/accessibility/source/helper
diff options
context:
space:
mode:
authorKohei Yoshida <kohei@openoffice.org>2009-08-20 19:55:14 +0000
committerKohei Yoshida <kohei@openoffice.org>2009-08-20 19:55:14 +0000
commitedd0ebc6c47352de490041bb05cd5875738ba902 (patch)
treef481ca27fee5892f7c9381ed34977c786f4367e0 /accessibility/source/helper
parentb30732a7e8691804e9b0a0f4d10dd1e9054983fc (diff)
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.
Diffstat (limited to 'accessibility/source/helper')
-rw-r--r--accessibility/source/helper/acc_factory.cxx12
1 files changed, 6 insertions, 6 deletions
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 <accessibility/extended/accessibleeditbrowseboxcell.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/combobox.hxx>
+#include "vcl/floatwin.hxx"
#include <floatingwindowaccessible.hxx>
@@ -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<FloatingWindow*>(
+ pWindow->GetAccessibleChildWindow(0));
+ if ( pChild->IsPopupMenu() )
{
// Get the accessible context from the child window.
Reference<XAccessible> xAccessible = pChild->CreateAccessible();
if (xAccessible.is())
xContext = xAccessible->getAccessibleContext();
}
+ else
+ xContext = new FloatingWindowAccessible( _pXWindow );
}
else if ( nType == WINDOW_HELPTEXTWINDOW )
{