diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-01-22 10:20:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-01-22 16:29:40 +0000 |
commit | 9975c632c3bd142f295fc1d9b1fd6059c3a2dbcb (patch) | |
tree | 8497185c0c4564ecefb19fcba56e65d00d76da12 /vcl/source/window/dlgctrl.cxx | |
parent | 2a3a15fd73d119062228480c22056e9cc9e4d680 (diff) |
rework accessibility to be layout aware
Change-Id: I9f8ddfc5007dad6f090abae7e3e0a2d637da0b37
Diffstat (limited to 'vcl/source/window/dlgctrl.cxx')
-rw-r--r-- | vcl/source/window/dlgctrl.cxx | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index be3697ea13d6..15078a0bda17 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -24,6 +24,7 @@ #include <window.h> #include <vcl/event.hxx> +#include <vcl/fixed.hxx> #include <vcl/layout.hxx> #include <vcl/svapp.hxx> #include <vcl/tabpage.hxx> @@ -434,6 +435,16 @@ static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, sal_Uni cCompareChar = xCharClass->toUpper( rtl::OUString(cCompareChar), 0, 1, rLocale )[0]; if ( cCompareChar == cCharCode ) { + if (pWindow->GetType() == WINDOW_FIXEDTEXT) + { + FixedText *pFixedText = static_cast<FixedText*>(pWindow); + Window *pMnemonicWidget = pFixedText->get_mnemonic_widget(); + SAL_WARN_IF(isContainerWindow(pFixedText->GetParent()) && !pMnemonicWidget, + "vcl.a11y", "label missing mnemonic_widget?"); + if (pMnemonicWidget) + return pMnemonicWidget; + } + // Bei Static-Controls auf das naechste Controlm weiterschalten if ( (pWindow->GetType() == WINDOW_FIXEDTEXT) || (pWindow->GetType() == WINDOW_FIXEDLINE) || @@ -1207,15 +1218,8 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window return pWindow; } -Window* Window::GetAccessibleRelationLabelFor() const +Window* Window::getLegacyNonLayoutAccessibleRelationLabelFor() const { - if ( mpWindowImpl->mbDisableAccessibleLabelForRelation ) - return NULL; - - if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabelForWindow ) - return mpWindowImpl->mpAccessibleInfos->pLabelForWindow; - - Window* pWindow = NULL; Window* pFrameWindow = ImplGetFrameWindow(); @@ -1296,14 +1300,8 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo return pWindow; } -Window* Window::GetAccessibleRelationLabeledBy() const +Window* Window::getLegacyNonLayoutAccessibleRelationLabeledBy() const { - if ( mpWindowImpl->mbDisableAccessibleLabeledByRelation ) - return NULL; - - if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabeledByWindow ) - return mpWindowImpl->mpAccessibleInfos->pLabeledByWindow; - Window* pWindow = NULL; Window* pFrameWindow = ImplGetFrameWindow(); @@ -1332,11 +1330,8 @@ Window* Window::GetAccessibleRelationLabeledBy() const return pWindow; } -Window* Window::GetAccessibleRelationMemberOf() const +Window* Window::getLegacyNonLayoutAccessibleRelationMemberOf() const { - if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pMemberOfWindow ) - return mpWindowImpl->mpAccessibleInfos->pMemberOfWindow; - Window* pWindow = NULL; Window* pFrameWindow = GetParent(); if ( !pFrameWindow ) |