Kaydet (Commit) c294a21d authored tarafından Caolán McNamara's avatar Caolán McNamara

revert removal of used a11y code

reverting the a11y parts of bc34a22e
so that we can now make use of them

Change-Id: I8090a2f9602743628d3b948338b45ed2252501eb
üst e9b0e18b
......@@ -1004,9 +1004,12 @@ public:
void SetAccessibleRelationLabeledBy( Window* pLabeledBy );
Window* GetAccessibleRelationLabeledBy() const;
void SetAccessibleRelationLabelFor( Window* pLabelFor );
Window* GetAccessibleRelationLabelFor() const;
void SetAccessibleRelationMemberOf( Window* pMemberOf );
Window* GetAccessibleRelationMemberOf() const;
// to avoid sending accessibility events in cases like closing dialogs
// by default checks complete parent path
......
......@@ -1332,6 +1332,61 @@ Window* Window::GetAccessibleRelationLabeledBy() const
return pWindow;
}
Window* Window::GetAccessibleRelationMemberOf() const
{
Window* pWindow = NULL;
Window* pFrameWindow = GetParent();
if ( !pFrameWindow )
{
pFrameWindow = ImplGetFrameWindow();
}
// if( ! ( GetType() == WINDOW_FIXEDTEXT ||
if( !( GetType() == WINDOW_FIXEDLINE ||
GetType() == WINDOW_GROUPBOX ) )
{
// search for a control that makes member of this window
// it is considered the last fixed line or group box
// that comes before this control; with the exception of push buttons
// which are labeled only if the fixed line or group box
// is directly before the control
// get form start and form end and index of this control
sal_uInt16 nIndex, nFormStart, nFormEnd;
Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
const_cast<Window*>(this),
nIndex,
nFormStart,
nFormEnd );
if( pSWindow && nIndex != nFormStart )
{
if( GetType() == WINDOW_PUSHBUTTON ||
GetType() == WINDOW_HELPBUTTON ||
GetType() == WINDOW_OKBUTTON ||
GetType() == WINDOW_CANCELBUTTON )
{
nFormStart = nIndex-1;
}
for( sal_uInt16 nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- )
{
sal_uInt16 nFoundIndex = 0;
pSWindow = ::ImplGetChildWindow( pFrameWindow,
nSearchIndex,
nFoundIndex,
sal_False );
if( pSWindow && pSWindow->IsVisible() &&
( pSWindow->GetType() == WINDOW_FIXEDLINE ||
pSWindow->GetType() == WINDOW_GROUPBOX ) )
{
pWindow = pSWindow;
break;
}
if( nFoundIndex > nSearchIndex || nSearchIndex == 0 )
break;
}
}
}
return pWindow;
}
// -----------------------------------------------------------------------
KeyEvent Window::GetActivationKey() const
......
......@@ -8966,6 +8966,13 @@ void Window::SetAccessibleRelationLabeledBy( Window* pLabeledBy )
mpWindowImpl->mpAccessibleInfos->pLabeledByWindow = pLabeledBy;
}
void Window::SetAccessibleRelationLabelFor( Window* pLabelFor )
{
if ( !mpWindowImpl->mpAccessibleInfos )
mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
mpWindowImpl->mpAccessibleInfos->pLabelForWindow = pLabelFor;
}
void Window::SetAccessibleRelationMemberOf( Window* pMemberOfWin )
{
if ( !mpWindowImpl->mpAccessibleInfos )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment