From 186c34af5d5758b940cf84471b3464af764d8bb7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 3 Aug 2020 15:52:33 +0200 Subject: loplugin:flatten in sd Change-Id: I57cf26d800d8d414014b88c250ee1cbd47551bc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100007 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/ui/controller/slidelayoutcontroller.cxx | 52 +++++++++++------------ 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'sd/source/ui/controller') diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index 82a2e9bd21e3..41071def8409 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -217,34 +217,34 @@ LayoutToolbarMenu::LayoutToolbarMenu(SlideLayoutController* pControl, weld::Widg mxFrame2->show(); } - if( eMode == DrawViewMode_DRAW ) + if( eMode != DrawViewMode_DRAW ) + return; + + if( !mxFrame.is() ) + return; + + OUString sSlotStr; + + if( bInsertPage ) + sSlotStr = ".uno:DuplicatePage"; + else + sSlotStr = ".uno:Undo"; + + css::uno::Reference xSlotImage = vcl::CommandInfoProvider::GetXGraphicForCommand(sSlotStr, mxFrame); + + OUString sSlotTitle; + if( bInsertPage ) { - if( mxFrame.is() ) - { - OUString sSlotStr; - - if( bInsertPage ) - sSlotStr = ".uno:DuplicatePage"; - else - sSlotStr = ".uno:Undo"; - - css::uno::Reference xSlotImage = vcl::CommandInfoProvider::GetXGraphicForCommand(sSlotStr, mxFrame); - - OUString sSlotTitle; - if( bInsertPage ) - { - auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sSlotStr, mxControl->getModuleName()); - sSlotTitle = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); - } - else - sSlotTitle = SdResId( STR_RESET_LAYOUT ); - - mxMoreButton->set_label(sSlotTitle); - mxMoreButton->set_image(xSlotImage); - mxMoreButton->connect_clicked(LINK(this, LayoutToolbarMenu, SelectToolbarMenuHdl)); - mxMoreButton->show(); - } + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sSlotStr, mxControl->getModuleName()); + sSlotTitle = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); } + else + sSlotTitle = SdResId( STR_RESET_LAYOUT ); + + mxMoreButton->set_label(sSlotTitle); + mxMoreButton->set_image(xSlotImage); + mxMoreButton->connect_clicked(LINK(this, LayoutToolbarMenu, SelectToolbarMenuHdl)); + mxMoreButton->show(); } IMPL_LINK(LayoutToolbarMenu, SelectValueSetHdl, ValueSet*, pLayoutSet, void) -- cgit