summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 09:04:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 19:25:23 +0200
commit4cc702a7055c0e12c7cbf5e5e359e7cbc8b88020 (patch)
treef09f7167cdca22f16edb5a998c2f9714e4bdc698 /framework
parent393aa2b3dee9cca84a215635060b369a962ab179 (diff)
loplugin:buriedassign in f,h,i*
Change-Id: Iac753e528e13cb2565832a484e87f88061bbc91e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx44
1 files changed, 24 insertions, 20 deletions
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index 5c11600c31b9..ea76be37887c 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -730,29 +730,33 @@ bool Impl_ExistURLInMenu(
{
bool bValidFallback( false );
sal_uInt16 nCount( 0 );
- if ( rPopupMenu.is() && ( nCount = rPopupMenu->getItemCount() ) != 0 && sURL.getLength() )
+ if ( rPopupMenu.is() )
{
- for ( sal_uInt16 n = 0; n < nCount; ++n )
+ nCount = rPopupMenu->getItemCount();
+ if (nCount != 0 && sURL.getLength() )
{
- sal_uInt16 nId = rPopupMenu->getItemId( n );
- OUString aCmd( rPopupMenu->getCommand( nId ) );
-
- if ( !bValidFallback && aCmd.getLength() )
- {
- sFallback = aCmd;
- bValidFallback = true;
- }
-
- // match even if the menu command is more detailed
- // (maybe an additional query) #i28667#
- if ( aCmd.match( sURL ) )
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
{
- sURL = aCmd;
- const css::uno::Reference< css::graphic::XGraphic > xGraphic(
- rPopupMenu->getItemImage( nId ) );
- if ( xGraphic.is() )
- aImage = Image( xGraphic );
- return true;
+ sal_uInt16 nId = rPopupMenu->getItemId( n );
+ OUString aCmd( rPopupMenu->getCommand( nId ) );
+
+ if ( !bValidFallback && aCmd.getLength() )
+ {
+ sFallback = aCmd;
+ bValidFallback = true;
+ }
+
+ // match even if the menu command is more detailed
+ // (maybe an additional query) #i28667#
+ if ( aCmd.match( sURL ) )
+ {
+ sURL = aCmd;
+ const css::uno::Reference< css::graphic::XGraphic > xGraphic(
+ rPopupMenu->getItemImage( nId ) );
+ if ( xGraphic.is() )
+ aImage = Image( xGraphic );
+ return true;
+ }
}
}
}