cui/source/dialogs/scriptdlg.cxx | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-)
New commits: commit f315a959f4f5cae0f61910056bfb822c5111903e Author: Jochen Nitschke <j.nitschke+loger...@ok.de> Date: Sun Sep 10 09:43:21 2017 +0200 cppcheck: knownConditionTrueFalse 'bValid' is always true Change-Id: I3f73641286020a06a605867726d54376c47a06dc Reviewed-on: https://gerrit.libreoffice.org/42134 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 8b828d86665f..35a40f3be0bd 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -1002,23 +1002,10 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry ) ScopedVclPtrInstance< CuiInputDialog > xNewDlg( static_cast<vcl::Window*>(this), InputDialogMode::RENAME ); xNewDlg->SetObjectName( aNewName ); - bool bValid; - do - { - if ( xNewDlg->Execute() && !xNewDlg->GetObjectName().isEmpty() ) - { - OUString aUserSuppliedName = xNewDlg->GetObjectName(); - bValid = true; - if( bValid ) - aNewName = aUserSuppliedName; - } - else - { - // user hit cancel or hit OK with nothing in the editbox - return; - } - } - while ( !bValid ); + if ( !xNewDlg->Execute() || xNewDlg->GetObjectName().isEmpty() ) + return; // user hit cancel or hit OK with nothing in the editbox + + aNewName = xNewDlg->GetObjectName(); Sequence< Any > args( 1 ); args[ 0 ] <<= aNewName; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits