[Libreoffice-commits] core.git: accessibility/source compilerplugins/clang

Noel Grandin noel.grandin at collabora.co.uk
Tue May 16 09:58:22 UTC 2017


 accessibility/source/extended/AccessibleBrowseBoxBase.cxx   |    4 ++--
 accessibility/source/extended/AccessibleGridControlBase.cxx |    4 ++--
 accessibility/source/extended/accessibleiconchoicectrl.cxx  |    2 +-
 accessibility/source/extended/accessiblelistboxentry.cxx    |    2 +-
 accessibility/source/extended/accessibletablistboxtable.cxx |    2 +-
 accessibility/source/helper/acc_factory.cxx                 |    2 +-
 accessibility/source/standard/vclxaccessibletoolbox.cxx     |    4 ++--
 compilerplugins/clang/comparisonwithconstant.cxx            |   10 ----------
 8 files changed, 10 insertions(+), 20 deletions(-)

New commits:
commit 482ef1bfe95a32a6796ce5a3150f272845db7931
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue May 16 10:26:15 2017 +0200

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

diff --git a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
index f4b18d9e1208..5c21f9371849 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
@@ -389,7 +389,7 @@ tools::Rectangle AccessibleBrowseBoxBase::getBoundingBox()
     ensureIsAlive();
 
     tools::Rectangle aRect = implGetBoundingBox();
-    if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == aRect.Bottom() )
+    if ( aRect.Left() == 0 && aRect.Top() == 0 && aRect.Right() == 0 && aRect.Bottom() == 0 )
     {
         SAL_WARN( "accessibility", "rectangle doesn't exist" );
     }
@@ -402,7 +402,7 @@ tools::Rectangle AccessibleBrowseBoxBase::getBoundingBoxOnScreen()
     ensureIsAlive();
 
     tools::Rectangle aRect = implGetBoundingBoxOnScreen();
-    if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == aRect.Bottom() )
+    if ( aRect.Left() == 0 && aRect.Top() == 0 && aRect.Right() == 0 && aRect.Bottom() == 0 )
     {
         SAL_WARN( "accessibility", "rectangle doesn't exist" );
     }
diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx
index dd22d4c76af7..49b5a46f32a2 100644
--- a/accessibility/source/extended/AccessibleGridControlBase.cxx
+++ b/accessibility/source/extended/AccessibleGridControlBase.cxx
@@ -313,7 +313,7 @@ tools::Rectangle AccessibleGridControlBase::getBoundingBox()
     SolarMutexGuard aSolarGuard;
     ensureIsAlive();
     tools::Rectangle aRect = implGetBoundingBox();
-    if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == aRect.Bottom() )
+    if ( aRect.Left() == 0 && aRect.Top() == 0 && aRect.Right() == 0 && aRect.Bottom() == 0 )
     {
         SAL_WARN( "accessibility", "rectangle doesn't exist" );
     }
@@ -325,7 +325,7 @@ tools::Rectangle AccessibleGridControlBase::getBoundingBoxOnScreen()
     SolarMutexGuard aSolarGuard;
     ensureIsAlive();
     tools::Rectangle aRect = implGetBoundingBoxOnScreen();
-    if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == aRect.Bottom() )
+    if ( aRect.Left() == 0 && aRect.Top() == 0 && aRect.Right() == 0 && aRect.Bottom() == 0 )
     {
         SAL_WARN( "accessibility", "rectangle doesn't exist" );
     }
diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index 18a4a344495d..3ec6e6e29c04 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -337,7 +337,7 @@ namespace accessibility
         }
 
         // if only one entry is selected and its index is chosen to deselect -> no selection anymore
-        if ( 1 == nSelCount && bFound )
+        if ( nSelCount == 1 && bFound )
             pCtrl->SetNoSelection();
     }
 
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index dc1c80299e51..4f635be0cbac 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -316,7 +316,7 @@ namespace accessibility
         if ( !xParent.is() )
         {
             OSL_ENSURE( m_aEntryPath.size(), "AccessibleListBoxEntry::getAccessibleParent: invalid path!" );
-            if ( 1 == m_aEntryPath.size() )
+            if ( m_aEntryPath.size() == 1 )
             {   // we're a top level entry
                 // -> our parent is the tree listbox itself
                 if ( getListBox() )
diff --git a/accessibility/source/extended/accessibletablistboxtable.cxx b/accessibility/source/extended/accessibletablistboxtable.cxx
index 857de8c81c8f..2490cf12c5cd 100644
--- a/accessibility/source/extended/accessibletablistboxtable.cxx
+++ b/accessibility/source/extended/accessibletablistboxtable.cxx
@@ -79,7 +79,7 @@ namespace accessibility
                 case VclEventId::ControlLoseFocus :
                 {
                     uno::Any aOldValue, aNewValue;
-                    if ( VclEventId::ControlGetFocus == nEventId )
+                    if ( nEventId == VclEventId::ControlGetFocus )
                         aNewValue <<= AccessibleStateType::FOCUSED;
                     else
                         aOldValue <<= AccessibleStateType::FOCUSED;
diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx
index d74d2edc663c..bfc629239bd9 100644
--- a/accessibility/source/helper/acc_factory.cxx
+++ b/accessibility/source/helper/acc_factory.cxx
@@ -73,7 +73,7 @@ namespace {
 inline bool hasFloatingChild(vcl::Window *pWindow)
 {
     vcl::Window * pChild = pWindow->GetAccessibleChildWindow(0);
-    return pChild && WindowType::FLOATINGWINDOW == pChild->GetType();
+    return pChild && pChild->GetType() == WindowType::FLOATINGWINDOW;
 }
 
 // IAccessibleFactory
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx
index b8dd8e2436f4..d00778116f19 100644
--- a/accessibility/source/standard/vclxaccessibletoolbox.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx
@@ -160,8 +160,8 @@ namespace
 
     sal_Int64 SAL_CALL OToolBoxWindowItem::getSomething( const Sequence< sal_Int8 >& _rId )
     {
-        if  (   ( 16 == _rId.getLength() )
-            &&  ( 0 == memcmp( getUnoTunnelImplementationId().getConstArray(),  _rId.getConstArray(), 16 ) )
+        if  (   ( _rId.getLength() == 16 )
+            &&  ( memcmp( getUnoTunnelImplementationId().getConstArray(),  _rId.getConstArray(), 16 ) == 0 )
             )
             return reinterpret_cast< sal_Int64>( this );
 
diff --git a/compilerplugins/clang/comparisonwithconstant.cxx b/compilerplugins/clang/comparisonwithconstant.cxx
index 5f8deffaba28..b4ced1e70f23 100644
--- a/compilerplugins/clang/comparisonwithconstant.cxx
+++ b/compilerplugins/clang/comparisonwithconstant.cxx
@@ -30,16 +30,6 @@ public:
 
     virtual void run() override
     {
-        /*
-        StringRef fn( compiler.getSourceManager().getFileEntryForID(
-                          compiler.getSourceManager().getMainFileID())->getName() );
-        if (fn == SRCDIR "/sd/source/ui/framework/factories/ChildWindowPane.cxx")
-             return;
-        if (fn == SRCDIR "/forms/source/component/Date.cxx")
-             return;
-        if (fn == SRCDIR "/forms/source/component/Time.cxx")
-            return;
-*/
         TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
     }
 


More information about the Libreoffice-commits mailing list