diff options
author | Thomas Benisch <tbe@openoffice.org> | 2002-07-23 11:14:54 +0000 |
---|---|---|
committer | Thomas Benisch <tbe@openoffice.org> | 2002-07-23 11:14:54 +0000 |
commit | 2c8992695de3d79c94157636ce5e1419a7fa2cb4 (patch) | |
tree | b3cac7af48eef74ead69a8e1167125551ca5a5b1 /vcl/source/window | |
parent | ca540037c9359389f0e566e3b555ad854fc5efca (diff) |
#101462# JABG: Menu Popups have incorrect parent
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/menu.cxx | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 7de2971805c1..6843590390af 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2,9 +2,9 @@ * * $RCSfile: menu.cxx,v $ * - * $Revision: 1.63 $ + * $Revision: 1.64 $ * - * last change: $Author: tbe $ $Date: 2002-07-22 16:28:57 $ + * last change: $Author: tbe $ $Date: 2002-07-23 12:14:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1696,9 +1696,29 @@ void Menu::SelectItem( USHORT nItemId ) { if ( !mxAccessible.is() ) { - UnoWrapperBase* pWrapper = Application::GetUnoWrapper(); - if ( pWrapper ) - mxAccessible = pWrapper->CreateAccessible( this, bIsMenuBar ); + if ( pStartedFrom ) + { + for ( sal_uInt16 i = 0, nCount = pStartedFrom->GetItemCount(); i < nCount; ++i ) + { + sal_uInt16 nItemId = pStartedFrom->GetItemId( i ); + if ( static_cast< Menu* >( pStartedFrom->GetPopupMenu( nItemId ) ) == this ) + { + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > xParent = pStartedFrom->GetAccessible(); + if ( xParent.is() ) + { + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessibleContext > xParentContext( xParent->getAccessibleContext() ); + if ( xParentContext.is() ) + mxAccessible = xParentContext->getAccessibleChild( i ); + } + } + } + } + else + { + UnoWrapperBase* pWrapper = Application::GetUnoWrapper(); + if ( pWrapper ) + mxAccessible = pWrapper->CreateAccessible( this, bIsMenuBar ); + } } return mxAccessible; |