summaryrefslogtreecommitdiff
path: root/sc/source/ui/cctrl
diff options
context:
space:
mode:
authorKohei Yoshida <kohei@openoffice.org>2009-08-26 00:48:56 +0000
committerKohei Yoshida <kohei@openoffice.org>2009-08-26 00:48:56 +0000
commit1bb55ba13a1ed1f9b3d441898f77e33fd57e80c8 (patch)
tree14911ed0a16ae6a817858cb289c8c6fbe29e3267 /sc/source/ui/cctrl
parent470ec5c5121c4d44e297c11c68ff60e60cbce5e7 (diff)
Fire a menu highlight event on menu item selection change, to get the accessibility to work correctly.
Diffstat (limited to 'sc/source/ui/cctrl')
-rw-r--r--sc/source/ui/cctrl/dpcontrol.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 8fb49ea22..a3eb264d3 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -47,9 +47,11 @@
#include "AccessibleFilterTopWindow.hxx"
#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
using ::com::sun::star::uno::Reference;
using ::com::sun::star::accessibility::XAccessible;
+using ::com::sun::star::accessibility::XAccessibleContext;
using ::rtl::OUString;
using ::rtl::OUStringHash;
using ::std::vector;
@@ -706,6 +708,26 @@ void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSub
else
queueCloseSubMenu();
}
+
+ if (mxAccessible.is())
+ {
+ // Fire a menu highlight event since the accessibility framework
+ // needs this to track focus on menu items.
+ do
+ {
+ Reference<XAccessibleContext> xAccCxt = mxAccessible->getAccessibleContext();
+ if (!xAccCxt.is())
+ break;
+
+ Reference<XAccessible> xAccMenu = xAccCxt->getAccessibleChild(nPos);
+ if (!xAccMenu.is())
+ break;
+
+ VclAccessibleEvent aEvent(VCLEVENT_MENU_HIGHLIGHT, xAccMenu);
+ FireVclEvent(&aEvent);
+ }
+ while (false);
+ }
}
}