diff options
author | Philippe Jung <phil.jung@free.fr> | 2015-06-18 15:16:00 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-08-06 12:23:08 +0200 |
commit | fe57a17a2a6d165eb06c8d0920683a7939f5ee42 (patch) | |
tree | 6713e4531b0ce4ec328fc2bfc8fe0a88d6c58d80 /framework | |
parent | c7acd17b6f3bf38aa3666819c41c723d563b34fb (diff) |
Rename some toolbarmanager related variables
Renames some variable to ease the understanding of what does what
Change-Id: Idd84eb89b7c1fb56dd43d66edfbbeafedc319095
Reviewed-on: https://gerrit.libreoffice.org/16360
Reviewed-by: Philippe Jung <phil.jung@free.fr>
Tested-by: Philippe Jung <phil.jung@free.fr>
(cherry picked from commit 79be3a5e3856593bb759b6e521f06dc99c69c0ae)
Reviewed-on: https://gerrit.libreoffice.org/16363
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uielement/toolbarmanager.cxx | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index a0492af406c4..bf8fc492cc6b 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -1680,12 +1680,12 @@ bool ToolBarManager::MenuItemAllowed( sal_uInt16 ) const // popup menu for quick customization bool bHideDisabledEntries = !SvtMenuOptions().IsEntryHidingEnabled(); - ::PopupMenu aPopupMenu( FwkResId( POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION )); + ::PopupMenu aQuickCustomizationMenu( FwkResId( POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION )); if ( m_pToolBar->IsCustomize() ) { sal_uInt16 nPos( 0 ); - ::PopupMenu* pItemMenu( aPopupMenu.GetPopupMenu( 1 )); + ::PopupMenu* pVisibleItemsPopupMenu( aQuickCustomizationMenu.GetPopupMenu( 1 )); bool bIsFloating( false ); @@ -1695,72 +1695,73 @@ bool ToolBarManager::MenuItemAllowed( sal_uInt16 ) const if ( !bIsFloating ) { - aPopupMenu.EnableItem( MENUITEM_TOOLBAR_DOCKTOOLBAR, false ); - aPopupMenu.EnableItem( MENUITEM_TOOLBAR_DOCKALLTOOLBAR, false ); + aQuickCustomizationMenu.EnableItem( MENUITEM_TOOLBAR_DOCKTOOLBAR, false ); + aQuickCustomizationMenu.EnableItem( MENUITEM_TOOLBAR_DOCKALLTOOLBAR, false ); Reference< XDockableWindow > xDockable( VCLUnoHelper::GetInterface( m_pToolBar ), UNO_QUERY ); if( xDockable.is() ) - aPopupMenu.CheckItem( MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, xDockable->isLocked() ); + aQuickCustomizationMenu.CheckItem( MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, xDockable->isLocked() ); } else - aPopupMenu.EnableItem( MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, false ); + aQuickCustomizationMenu.EnableItem( MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, false ); if ( SvtMiscOptions().DisableUICustomization() ) { - aPopupMenu.EnableItem( MENUITEM_TOOLBAR_VISIBLEBUTTON, false ); - aPopupMenu.EnableItem( MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR, false ); - aPopupMenu.EnableItem( MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, false ); + aQuickCustomizationMenu.EnableItem( MENUITEM_TOOLBAR_VISIBLEBUTTON, false ); + aQuickCustomizationMenu.EnableItem( MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR, false ); + aQuickCustomizationMenu.EnableItem( MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, false ); } // Disable menu item CLOSE if the toolbar has no closer if( !(pToolBar->GetFloatStyle() & WB_CLOSEABLE) ) - aPopupMenu.EnableItem(MENUITEM_TOOLBAR_CLOSE, false); + aQuickCustomizationMenu.EnableItem(MENUITEM_TOOLBAR_CLOSE, false); + // Go through all toolbar items and add them to the context menu for ( nPos = 0; nPos < m_pToolBar->GetItemCount(); ++nPos ) { if ( m_pToolBar->GetItemType(nPos) == ToolBoxItemType::BUTTON ) { sal_uInt16 nId = m_pToolBar->GetItemId(nPos); OUString aCommandURL = m_pToolBar->GetItemCommand( nId ); - pItemMenu->InsertItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->GetItemText( nId ), MenuItemBits::CHECKABLE ); - pItemMenu->CheckItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->IsItemVisible( nId ) ); - pItemMenu->SetItemCommand( STARTID_CUSTOMIZE_POPUPMENU+nPos, aCommandURL ); - pItemMenu->SetItemImage( STARTID_CUSTOMIZE_POPUPMENU+nPos, - GetImageFromURL( m_xFrame, aCommandURL, false ) - ); + pVisibleItemsPopupMenu->InsertItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->GetItemText( nId ), MenuItemBits::CHECKABLE ); + pVisibleItemsPopupMenu->CheckItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->IsItemVisible( nId ) ); + pVisibleItemsPopupMenu->SetItemCommand( STARTID_CUSTOMIZE_POPUPMENU+nPos, aCommandURL ); + Image aImage( GetImageFromURL( m_xFrame, aCommandURL, false ) ); + pVisibleItemsPopupMenu->SetItemImage( STARTID_CUSTOMIZE_POPUPMENU+nPos, aImage ); } else { - pItemMenu->InsertSeparator(); + pVisibleItemsPopupMenu->InsertSeparator(); } } } else { - sal_uInt16 nPos = aPopupMenu.GetItemPos( MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR ); + sal_uInt16 nPos = aQuickCustomizationMenu.GetItemPos( MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR ); if ( nPos != MENU_ITEM_NOTFOUND ) - aPopupMenu.RemoveItem( nPos ); + aQuickCustomizationMenu.RemoveItem( nPos ); } - // copy all menu items to the toolbar menu + // copy all menu items 'Visible buttons, Customize toolbar, Dock toolbar, + // Dock all Toolbars) from the loaded resource into the toolbar menu if( pMenu->GetItemCount() ) pMenu->InsertSeparator(); sal_uInt16 i; - for( i=0; i< aPopupMenu.GetItemCount(); i++) + for( i=0; i< aQuickCustomizationMenu.GetItemCount(); i++) { - sal_uInt16 nId = aPopupMenu.GetItemId( i ); + sal_uInt16 nId = aQuickCustomizationMenu.GetItemId( i ); if ( MenuItemAllowed( nId )) - pMenu->CopyItem( aPopupMenu, i, MENU_APPEND ); + pMenu->CopyItem( aQuickCustomizationMenu, i, MENU_APPEND ); } // set submenu to toolbar menu - if( aPopupMenu.GetPopupMenu( 1 ) ) + if( aQuickCustomizationMenu.GetPopupMenu( 1 ) ) { // create an own submenu to avoid auto-delete when resource menu is deleted ::PopupMenu *pItemMenu = new ::PopupMenu(); - for( i=0; i< aPopupMenu.GetPopupMenu( 1 )->GetItemCount(); i++) - pItemMenu->CopyItem( *aPopupMenu.GetPopupMenu( 1 ), i, MENU_APPEND ); + for( i=0; i< aQuickCustomizationMenu.GetPopupMenu( 1 )->GetItemCount(); i++) + pItemMenu->CopyItem( *aQuickCustomizationMenu.GetPopupMenu( 1 ), i, MENU_APPEND ); pMenu->SetPopupMenu( 1, pItemMenu ); } |