diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2013-09-07 20:14:18 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-09 17:57:10 +0000 |
commit | c0d50457e88e17a4a0b160f40e92bcfa154f780f (patch) | |
tree | 22e593187d105d2bb2018f48aa5b50780e3ef308 /vcl | |
parent | f96b23669e5ccb18f55e9041a774206b50406d2a (diff) |
CID#1078725: Dereference null return value
+ Some simplification
Change-Id: Ia4db65f3c6d4e712060753e15acbe160d4fe3ede
Reviewed-on: https://gerrit.libreoffice.org/5862
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/menu.cxx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index a62f87aff75f..8f24ac4a3cdc 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2010,18 +2010,13 @@ OUString Menu::ImplGetHelpText( sal_uInt16 nItemId ) const if ( pData && pData->aHelpText.isEmpty() && (( !pData->aHelpId.isEmpty() ) || ( !pData->aCommandStr.isEmpty() ))) { - if ( pData->aHelpText.isEmpty() && - (( !pData->aHelpId.isEmpty() ) || ( !pData->aCommandStr.isEmpty() ))) + Help* pHelp = Application::GetHelp(); + if ( pHelp ) { - Help* pHelp = Application::GetHelp(); - if ( pHelp ) - { - if (!pData->aCommandStr.isEmpty()) - pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL ); - - if( pData->aHelpText.isEmpty() && !pData->aHelpId.isEmpty() ) - pData->aHelpText = pHelp->GetHelpText( OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL ); - } + if (!pData->aCommandStr.isEmpty()) + pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL ); + if (pData->aHelpText.isEmpty() && !pData->aHelpId.isEmpty()) + pData->aHelpText = pHelp->GetHelpText( OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL ); } } |