[Libreoffice-commits] core.git: cui/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Sun Sep 10 11:43:58 UTC 2017


 cui/source/dialogs/scriptdlg.cxx |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

New commits:
commit f315a959f4f5cae0f61910056bfb822c5111903e
Author: Jochen Nitschke <j.nitschke+logerrit at 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 <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at 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;


More information about the Libreoffice-commits mailing list