summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/a11y/atkwindow.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei@openoffice.org>2009-08-27 02:35:27 +0000
committerKohei Yoshida <kohei@openoffice.org>2009-08-27 02:35:27 +0000
commit2e77984f087afde2ba0ca0edc5987a6f52d1095e (patch)
tree28c3c4f0413a2a603bccf1e8c00be7731ce35fa8 /vcl/unx/gtk/a11y/atkwindow.cxx
parent22aa57f666acce83cf8227eb54ee386ae3be8445 (diff)
Added a new child class of FloatingWindow to separate popup menu specific stuff to it. Let's leave the existing FloatingWindow alone.
Diffstat (limited to 'vcl/unx/gtk/a11y/atkwindow.cxx')
-rw-r--r--vcl/unx/gtk/a11y/atkwindow.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx
index 83f4c1035916..1bda4eea774e 100644
--- a/vcl/unx/gtk/a11y/atkwindow.cxx
+++ b/vcl/unx/gtk/a11y/atkwindow.cxx
@@ -33,7 +33,7 @@
#include <plugins/gtk/gtkframe.hxx>
#include <vcl/window.hxx>
-#include "vcl/floatwin.hxx"
+#include "vcl/popupmenuwindow.hxx"
#include "atkwindow.hxx"
#include "atkwrapper.hxx"
@@ -111,8 +111,8 @@ init_from_window( AtkObject *accessible, Window *pWindow )
}
else if ( pWindow->GetType() == WINDOW_BORDERWINDOW && pChild->GetType() == WINDOW_FLOATINGWINDOW )
{
- sal_uInt16 nStackLevel = static_cast<FloatingWindow*>(pChild)->GetMenuStackLevel();
- if (nStackLevel == 0)
+ PopupMenuFloatingWindow* p = dynamic_cast<PopupMenuFloatingWindow*>(pChild);
+ if (p && p->IsPopupMenu() && p->GetMenuStackLevel() == 0)
{
// This is a top-level menu popup. Register it.
role = ATK_ROLE_POPUP_MENU;
@@ -158,7 +158,11 @@ isChildPopupMenu(Window* pWindow)
if (WINDOW_FLOATINGWINDOW != pChild->GetType())
return false;
- return static_cast<FloatingWindow*>(pChild)->IsPopupMenu();
+ PopupMenuFloatingWindow* p = dynamic_cast<PopupMenuFloatingWindow*>(pChild);
+ if (!p)
+ return false;
+
+ return p->IsPopupMenu();
}
static void