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

Noel Grandin noel.grandin at collabora.co.uk
Tue May 16 10:10:24 UTC 2017


 basctl/source/basicide/baside2.cxx  |    2 +-
 basctl/source/basicide/baside3.cxx  |   12 ++++++------
 basctl/source/basicide/basides1.cxx |    2 +-
 basctl/source/dlged/managelang.cxx  |    2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 658eec1d5b96ea0a971fbdf531979480f72516a4
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue May 16 10:42:03 2017 +0200

    loplugin:comparisonwithconstant in basctl
    
    Change-Id: I0ac895e279e4feb47345e73ecef0d5ee1909c031
    Reviewed-on: https://gerrit.libreoffice.org/37668
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 9692a5e9660d..7a03c14aa61a 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1035,7 +1035,7 @@ void ModulWindow::ExecuteGlobal (SfxRequest& rReq)
 void ModulWindow::GetState( SfxItemSet &rSet )
 {
     SfxWhichIter aIter(rSet);
-    for ( sal_uInt16 nWh = aIter.FirstWhich(); 0 != nWh; nWh = aIter.NextWhich() )
+    for ( sal_uInt16 nWh = aIter.FirstWhich(); nWh != 0; nWh = aIter.NextWhich() )
     {
         switch ( nWh )
         {
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 550bcd3637e9..fa499ae2dcc9 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -253,7 +253,7 @@ void DialogWindow::GetState( SfxItemSet& rSet )
         }
     }
 
-    for ( sal_uInt16 nWh = aIter.FirstWhich(); 0 != nWh; nWh = aIter.NextWhich() )
+    for ( sal_uInt16 nWh = aIter.FirstWhich(); nWh != 0; nWh = aIter.NextWhich() )
     {
         switch ( nWh )
         {
@@ -913,19 +913,19 @@ bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const Script
 
                 ScopedVclPtrInstance< NameClashQueryBox > aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
                 sal_uInt16 nRet = aQueryBox->Execute();
-                if( RET_YES == nRet )
+                if( nRet == RET_YES )
                 {
                     // RET_YES == Rename, see NameClashQueryBox::NameClashQueryBox
                     eNameClashMode = CLASH_RENAME_DIALOG;
 
                     aNewDlgName = rDocument.createObjectName( E_DIALOGS, aLibName );
                 }
-                else if( RET_NO == nRet )
+                else if( nRet == RET_NO )
                 {
                     // RET_NO == Replace, see NameClashQueryBox::NameClashQueryBox
                     eNameClashMode = CLASH_OVERWRITE_DIALOG;
                 }
-                else if( RET_CANCEL == nRet )
+                else if( nRet == RET_CANCEL )
                 {
                     return bDone;
                 }
@@ -975,7 +975,7 @@ bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const Script
                 OUString aQueryBoxText(IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_TEXT));
                 ScopedVclPtrInstance< LanguageMismatchQueryBox > aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
                 sal_uInt16 nRet = aQueryBox->Execute();
-                if( RET_YES == nRet )
+                if( nRet == RET_YES )
                 {
                     // RET_YES == Add, see LanguageMismatchQueryBox::LanguageMismatchQueryBox
                     bAddDialogLanguagesToLib = true;
@@ -985,7 +985,7 @@ bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const Script
                 //else if( RET_NO == nRet )
                 //{
                 //}
-                else if( RET_CANCEL == nRet )
+                else if( nRet == RET_CANCEL )
                 {
                     return bDone;
                 }
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index e6811d28d86e..a6f59641b13e 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -695,7 +695,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
 void Shell::GetState(SfxItemSet &rSet)
 {
     SfxWhichIter aIter(rSet);
-    for ( sal_uInt16 nWh = aIter.FirstWhich(); 0 != nWh; nWh = aIter.NextWhich() )
+    for ( sal_uInt16 nWh = aIter.FirstWhich(); nWh != 0; nWh = aIter.NextWhich() )
     {
         switch ( nWh )
         {
diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx
index 4b979921dbf5..a396f0fe0842 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -147,7 +147,7 @@ void ManageLanguageDialog::ClearLanguageBox()
 IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl, Button*, void)
 {
     ScopedVclPtrInstance< SetDefaultLanguageDialog > aDlg( this, m_xLocalizationMgr );
-    if ( RET_OK == aDlg->Execute() )
+    if ( aDlg->Execute() == RET_OK )
     {
         // add new locales
         Sequence< Locale > aLocaleSeq = aDlg->GetLocales();


More information about the Libreoffice-commits mailing list