diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-09-10 09:43:21 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-09-10 13:43:37 +0200 |
commit | f315a959f4f5cae0f61910056bfb822c5111903e (patch) | |
tree | 99c021a37908890cc759e246c7e4be28305d6c59 /cui/source/dialogs/scriptdlg.cxx | |
parent | 69057cd178f30b53728b6d57468f520ffbbeadbc (diff) |
cppcheck: knownConditionTrueFalse 'bValid' is always true
Change-Id: I3f73641286020a06a605867726d54376c47a06dc
Reviewed-on: https://gerrit.libreoffice.org/42134
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'cui/source/dialogs/scriptdlg.cxx')
-rw-r--r-- | cui/source/dialogs/scriptdlg.cxx | 21 |
1 files changed, 4 insertions, 17 deletions
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; |