framework/source/uielement/menubarmanager.cxx | 5 +++ framework/source/uielement/menubarwrapper.cxx | 4 +++ vcl/inc/vcl/menu.hxx | 4 +++ vcl/source/window/menu.cxx | 33 ++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-)
New commits: commit 432cb6e505251a6465db5b1d49f5831b0b4ec380 Author: Antonio Fernandez <antonio.fernan...@aentos.es> Date: Thu Jul 19 17:40:17 2012 +0100 Added a "freeze" method to Menu. Menus are now displayed on console. Change-Id: I71bfc2c0272154b9ff5c2dabe7508a98950e199c diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 5e85620..d19a8bb 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -1004,6 +1004,9 @@ IMPL_LINK( MenuBarManager, Activate, AbstractMenu *, pMenu ) } } +// pMenu->Freeze(); + m_pVCLMenu->Freeze(); + return 1; } @@ -1708,7 +1711,7 @@ void MenuBarManager::FillMenu( { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "ocke.jans...@sun.com", "MenuBarManager::FillMenu" ); // Fill menu bar with container contents - for ( sal_Int32 n = 0; n < rItemContainer->getCount(); n++ ) + for ( sal_Int32 n = 0; n < rItemContainer->getCount(); n++ ) { Sequence< PropertyValue > aProp; rtl::OUString aCommandURL; diff --git a/framework/source/uielement/menubarwrapper.cxx b/framework/source/uielement/menubarwrapper.cxx index 45d5bf8..888f9d8 100644 --- a/framework/source/uielement/menubarwrapper.cxx +++ b/framework/source/uielement/menubarwrapper.cxx @@ -181,6 +181,7 @@ void SAL_CALL MenuBarWrapper::initialize( const Sequence< Any >& aArguments ) th // Fill menubar with container contents sal_uInt16 nId = 1; MenuBarManager::FillMenuWithConfiguration( nId, pVCLMenuBar, aModuleIdentifier, m_xConfigData, xTrans ); +// pVCLMenuBar->Freeze(); } } catch ( const NoSuchElementException& ) @@ -222,6 +223,9 @@ void SAL_CALL MenuBarWrapper::initialize( const Sequence< Any >& aArguments ) th // Don't use this toolkit menu bar or one of its functions. It is only used as a data container! pAwtMenuBar = new VCLXMenuBar( pVCLMenuBar ); m_xMenuBar = Reference< XMenuBar >( static_cast< OWeakObject *>( pAwtMenuBar ), UNO_QUERY ); + + // Freeze the menubar + pVCLMenuBar->Freeze(); } } } diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx index 3c4c753..f98e87e 100644 --- a/vcl/inc/vcl/menu.hxx +++ b/vcl/inc/vcl/menu.hxx @@ -198,6 +198,8 @@ public: // Returns the system's menu handle if native menus are supported // pData must point to a SystemMenuData structure virtual sal_Bool GetSystemMenuData( SystemMenuData* pData ) const = 0; + + virtual void Freeze(void) = 0; }; // -------- @@ -455,6 +457,8 @@ public: void HighlightItem( sal_uInt16 nItemPos ); void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID + + void Freeze(); }; // ----------- diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 3b4ac0d..121ee14 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -6063,4 +6063,37 @@ ImplMenuDelData::~ImplMenuDelData() const_cast< Menu* >( mpMenu )->ImplRemoveDel( *this ); } +#include <iostream> +using namespace std; + +void printMenu( AbstractMenu* pMenu ) { + if ( pMenu ) { + sal_uInt16 itemCount = pMenu->GetItemCount(); + MenuItemList *items = ((Menu*)pMenu)->GetItemList(); + + for (int i=0; i < itemCount; i++) { + MenuItemData *itemData = items->GetDataFromPos(i); + sal_uInt16 itemId = pMenu->GetItemId(i); + + if (itemData->eType == MENUITEM_SEPARATOR) { + cout << "---------------" << endl; + } else { + rtl::OUString itemText = itemData->aText; + rtl::OUString cmdString = itemData->aCommandStr; + cout << "Item ID: " << itemId << " Text: " << itemText << " CMD: " << cmdString << endl; + + if (itemData->pSubMenu) { + cout << ">> SUBMENU <<" << endl; + printMenu( itemData->pSubMenu ); + } + } + } + } +} + +void Menu::Freeze() { + printMenu( this ); + cout << "============================================================" << endl; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits