diff options
author | Oliver Bolte <obo@openoffice.org> | 2006-10-13 08:43:27 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2006-10-13 08:43:27 +0000 |
commit | 9cacfaa0bf3c584528bae13f195c936f762f94db (patch) | |
tree | 26a241eced6747de68d865a24e8a7a35d6c28e4d | |
parent | dcb34598eb2218a41672d0af83e5ff1deb84b1f0 (diff) |
INTEGRATION: CWS fwk48 (1.39.12); FILE MERGED
2006/09/18 12:10:49 as 1.39.12.4: resolve conflicts after merging
2006/09/18 07:50:29 as 1.39.12.3: RESYNC: (1.39-1.40); FILE MERGED
2006/09/13 11:32:24 cd 1.39.12.2: #i68984# Property strings must be members to profit from ref counting
2006/08/31 12:34:47 cd 1.39.12.1: #i68851# Disable empty popups
-rw-r--r-- | framework/source/uielement/menubarmanager.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index be6e15d30d0a..879780c789c8 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -4,9 +4,9 @@ * * $RCSfile: menubarmanager.cxx,v $ * - * $Revision: 1.42 $ + * $Revision: 1.43 $ * - * last change: $Author: obo $ $Date: 2006-10-12 10:43:18 $ + * last change: $Author: obo $ $Date: 2006-10-13 09:43:27 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1065,6 +1065,12 @@ void MenuBarManager::CheckAndAddMenuExtension( Menu* pMenu ) } } +static void lcl_CheckForChildren(Menu* pMenu, USHORT nItemId) +{ + if (PopupMenu* pThisPopup = pMenu->GetPopupMenu( nItemId )) + pMenu->EnableItem( nItemId, pThisPopup->GetItemCount() ? true : false ); +} + //_________________________________________________________________________________________________________________ // vcl handler //_________________________________________________________________________________________________________________ @@ -1252,8 +1258,13 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu ) // Force update of popup menu pMenuItemHandler->xPopupMenuController->updatePopupMenu(); bPopupMenu = sal_True; + if (PopupMenu* pThisPopup = pMenu->GetPopupMenu( pMenuItemHandler->nItemId )) + pMenu->EnableItem( pMenuItemHandler->nItemId, pThisPopup->GetItemCount() ? true : false ); + } + lcl_CheckForChildren(pMenu, pMenuItemHandler->nItemId); + if ( xMenuItemDispatch.is() ) { pMenuItemHandler->xMenuItemDispatch = xMenuItemDispatch; @@ -1274,6 +1285,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu ) { // Force update of popup menu pMenuItemHandler->xPopupMenuController->updatePopupMenu(); + lcl_CheckForChildren(pMenu, pMenuItemHandler->nItemId); } else if ( pMenuItemHandler->xMenuItemDispatch.is() ) { @@ -1292,6 +1304,8 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu ) { } } + else if ( pMenuItemHandler->xSubMenuManager.is() ) + lcl_CheckForChildren(pMenu, pMenuItemHandler->nItemId); } } } @@ -1662,6 +1676,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, Reference< XFrame >& rFrame, if ( CreatePopupMenuController( pItemHandler )) pItemHandler->xPopupMenuController->updatePopupMenu(); } + lcl_CheckForChildren(pMenu, nItemId); } else if (( aItemCommand.getLength() > nAddonsURLPrefixLength ) && ( aItemCommand.indexOf( ADDONSPOPUPMENU_URL_PREFIX ) == 0 )) @@ -1809,6 +1824,8 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, Reference< XFrame >& rFrame, if ( CreatePopupMenuController( pItemHandler )) pItemHandler->xPopupMenuController->updatePopupMenu(); } + + lcl_CheckForChildren(pMenu, pItemHandler->nItemId); } m_aMenuItemHandlerVector.push_back( pItemHandler ); |