diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-10-15 16:37:14 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-10-15 16:37:14 +0000 |
commit | db401862de80bb4caa90db55dec5abc9cf7f3f7f (patch) | |
tree | 4e2528f6ec3819ddde7a83f221eb4d29d5d66449 /framework/source/classes/addonmenu.cxx | |
parent | 3482433683e58276ee6146f67bbd49f457bb7563 (diff) |
INTEGRATION: CWS c05v005_SRC680 (1.12.78); FILE MERGED
2007/09/13 07:01:58 cd 1.12.78.1: #150543# Use 'Registration' and 'About' as reference points for add-on help menu merging
Diffstat (limited to 'framework/source/classes/addonmenu.cxx')
-rw-r--r-- | framework/source/classes/addonmenu.cxx | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/framework/source/classes/addonmenu.cxx b/framework/source/classes/addonmenu.cxx index 9f1db8beec18..3051bb2418f9 100644 --- a/framework/source/classes/addonmenu.cxx +++ b/framework/source/classes/addonmenu.cxx @@ -4,9 +4,9 @@ * * $RCSfile: addonmenu.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: ihi $ $Date: 2007-04-16 16:34:34 $ + * last change: $Author: ihi $ $Date: 2007-10-15 17:37:14 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -263,7 +263,11 @@ void AddonMenuManager::MergeAddonHelpMenu( const Reference< XFrame >& rFrame, Me if ( pHelpMenu ) { + static const char REFERENCECOMMAND_AFTER[] = ".uno:OnlineRegistrationDlg"; + static const char REFERENCECOMMAND_BEFORE[] = ".uno:About"; + // Add-Ons help menu items should be inserted after the "registration" menu item + bool bAddAfter = true; USHORT nItemCount = pHelpMenu->GetItemCount(); USHORT nRegPos = pHelpMenu->GetItemPos( SID_ONLINE_REGISTRATION ); USHORT nInsPos = nRegPos; @@ -274,15 +278,25 @@ void AddonMenuManager::MergeAddonHelpMenu( const Reference< XFrame >& rFrame, Me if ( nRegPos == USHRT_MAX ) { // try to detect the online registration dialog menu item with the command URL - USHORT nId = FindMenuId( pHelpMenu, String::CreateFromAscii( ".uno:OnlineRegistrationDlg" )); - nRegPos = pHelpMenu->GetItemPos( nId ); - nInsPos = nRegPos; + USHORT nId = FindMenuId( pHelpMenu, String::CreateFromAscii( REFERENCECOMMAND_AFTER )); + nRegPos = pHelpMenu->GetItemPos( nId ); + nInsPos = nRegPos; + } + + if ( nRegPos == USHRT_MAX ) + { + // second try: + // try to detect the about menu item with the command URL + USHORT nId = FindMenuId( pHelpMenu, String::CreateFromAscii( REFERENCECOMMAND_BEFORE )); + nRegPos = pHelpMenu->GetItemPos( nId ); + nInsPos = nRegPos; + bAddAfter = false; } Sequence< Sequence< PropertyValue > > aAddonSubMenu; const Sequence< Sequence< PropertyValue > >& rAddonHelpMenuEntries = aOptions.GetAddonsHelpMenu(); - nInsPos = AddonMenuManager::GetNextPos( nInsPos ); + nInsPos = bAddAfter ? AddonMenuManager::GetNextPos( nInsPos ) : nInsPos; if ( nInsPos < nItemCount && pHelpMenu->GetItemType( nInsPos ) != MENUITEM_SEPARATOR ) nInsSepAfterPos = nInsPos; |