summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/window/menuwindow.cxx19
1 files changed, 13 insertions, 6 deletions
diff --git a/vcl/source/window/menuwindow.cxx b/vcl/source/window/menuwindow.cxx
index 36ed07f0730d..802c62e285f8 100644
--- a/vcl/source/window/menuwindow.cxx
+++ b/vcl/source/window/menuwindow.cxx
@@ -91,17 +91,24 @@ bool MenuWindow::ImplHandleHelpEvent(vcl::Window* pMenuWindow, Menu const * pMen
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- // is an id available, then call help with the id, otherwise
- // use help-index
+ // Check if there is a Help ID available, or else use
+ // the command URL
OUString aCommand = pMenu->GetItemCommand( nId );
- OUString aHelpId( pMenu->GetHelpId( nId ) );
+ OUString aHelpId;
+
+ // If no entry is selected, use the general menu Help ID
+ if (nId <= 0)
+ aHelpId = pMenu->GetHelpId();
+ else
+ aHelpId = pMenu->GetHelpId(nId);
+
if( aHelpId.isEmpty() )
aHelpId = OOO_HELP_INDEX;
- if ( !aCommand.isEmpty() )
- pHelp->Start(aCommand);
- else
+ if ( !aHelpId.isEmpty() )
pHelp->Start(aHelpId);
+ else
+ pHelp->Start(aCommand);
}
bDone = true;
}