[Libreoffice-commits] core.git: 2 commits - comphelper/source compilerplugins/clang configmgr/source include/comphelper

Stephan Bergmann sbergman at redhat.com
Wed Jul 2 09:50:40 PDT 2014


 comphelper/source/misc/accessibleselectionhelper.cxx |    8 +++---
 comphelper/source/misc/accimplaccess.cxx             |    2 -
 compilerplugins/clang/salbool.cxx                    |   22 +++++++------------
 configmgr/source/writemodfile.cxx                    |    2 +
 include/comphelper/accessibleselectionhelper.hxx     |    2 -
 include/comphelper/accimplaccess.hxx                 |    2 -
 6 files changed, 18 insertions(+), 20 deletions(-)

New commits:
commit c95ff75df274e3d84458e928ee96870bc8b663b3
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jul 2 18:49:31 2014 +0200

    comphelper: sal_Bool -> bool
    
    Change-Id: Icde90101b6adfa766c8abbeb55c518725e6596e1

diff --git a/comphelper/source/misc/accessibleselectionhelper.cxx b/comphelper/source/misc/accessibleselectionhelper.cxx
index 35c6622..814faa1 100644
--- a/comphelper/source/misc/accessibleselectionhelper.cxx
+++ b/comphelper/source/misc/accessibleselectionhelper.cxx
@@ -42,7 +42,7 @@ namespace comphelper
 
     void SAL_CALL OCommonAccessibleSelection::selectAccessibleChild( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
     {
-        implSelect( nChildIndex, sal_True );
+        implSelect( nChildIndex, true );
     }
 
 
@@ -54,13 +54,13 @@ namespace comphelper
 
     void SAL_CALL OCommonAccessibleSelection::clearAccessibleSelection(  ) throw (RuntimeException)
     {
-        implSelect( ACCESSIBLE_SELECTION_CHILD_ALL, sal_False );
+        implSelect( ACCESSIBLE_SELECTION_CHILD_ALL, false );
     }
 
 
     void SAL_CALL OCommonAccessibleSelection::selectAllAccessibleChildren(  ) throw (RuntimeException)
     {
-        implSelect( ACCESSIBLE_SELECTION_CHILD_ALL, sal_True );
+        implSelect( ACCESSIBLE_SELECTION_CHILD_ALL, true );
     }
 
 
@@ -102,7 +102,7 @@ namespace comphelper
 
     void SAL_CALL OCommonAccessibleSelection::deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
     {
-        implSelect( nSelectedChildIndex, sal_False );
+        implSelect( nSelectedChildIndex, false );
     }
 
 
diff --git a/comphelper/source/misc/accimplaccess.cxx b/comphelper/source/misc/accimplaccess.cxx
index 6cf5637..96f255d 100644
--- a/comphelper/source/misc/accimplaccess.cxx
+++ b/comphelper/source/misc/accimplaccess.cxx
@@ -84,7 +84,7 @@ namespace comphelper
     }
 
 
-    void OAccessibleImplementationAccess::setStateBit( const sal_Int16 _nState, const sal_Bool _bSet )
+    void OAccessibleImplementationAccess::setStateBit( const sal_Int16 _nState, const bool _bSet )
     {
         OSL_ENSURE( _nState >= 0 && static_cast< sal_uInt16 >(_nState) < sizeof( sal_Int64 ) * 8, "OAccessibleImplementationAccess::setStateBit: no more bits (shutting down the universe now)!" );
 
diff --git a/include/comphelper/accessibleselectionhelper.hxx b/include/comphelper/accessibleselectionhelper.hxx
index dbc4c20..4bb64a9 100644
--- a/include/comphelper/accessibleselectionhelper.hxx
+++ b/include/comphelper/accessibleselectionhelper.hxx
@@ -62,7 +62,7 @@ namespace comphelper
 
         // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
         virtual void
-            implSelect( sal_Int32 nAccessibleChildIndex, sal_Bool bSelect )
+            implSelect( sal_Int32 nAccessibleChildIndex, bool bSelect )
             throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) = 0;
 
     protected:
diff --git a/include/comphelper/accimplaccess.hxx b/include/comphelper/accimplaccess.hxx
index f416e14..2c6f159 100644
--- a/include/comphelper/accimplaccess.hxx
+++ b/include/comphelper/accimplaccess.hxx
@@ -85,7 +85,7 @@ namespace comphelper
             const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxAccParent );
 
         /// sets or resets a bit of the foreign controlled states
-        void setStateBit( const sal_Int16 _nState, const sal_Bool _bSet );
+        void setStateBit( const sal_Int16 _nState, const bool _bSet );
 
     protected:
         OAccessibleImplementationAccess( );
commit 0e8d69fa7df1e238bc82b08d37babe9cd4cb5f5d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jul 2 18:48:18 2014 +0200

    Make configmgr loplugin:salbool-clean
    
    Change-Id: Ib1f33387c50bcd853140eb2fc46995d23d7f367b

diff --git a/compilerplugins/clang/salbool.cxx b/compilerplugins/clang/salbool.cxx
index 6ef85b3..f8ae35e 100644
--- a/compilerplugins/clang/salbool.cxx
+++ b/compilerplugins/clang/salbool.cxx
@@ -70,23 +70,19 @@ OverrideKind getOverrideKind(FunctionDecl const * decl) {
 
 //TODO: current implementation is not at all general, just tests what we
 // encounter in practice:
-bool hasBoolOverload(FunctionDecl const * decl) {
-    if (isa<CXXMethodDecl>(decl)) {
-        unsigned n = decl->getNumParams();
-        CXXRecordDecl const * r = dyn_cast<CXXRecordDecl>(
-            decl->getDeclContext());
-        assert(r != nullptr);
-        for (auto m = r->method_begin(); m != r->method_end(); ++m) {
-            if (m->getDeclName() == decl->getDeclName()
-                && m->getNumParams() == n)
-            {
+bool hasBoolOverload(FunctionDecl const * decl, bool mustBeDeleted) {
+    unsigned n = decl->getNumParams();
+    for (auto d: decl->getDeclContext()->lookup(decl->getDeclName())) {
+        FunctionDecl const * f = dyn_cast<FunctionDecl>(d);
+        if (f != nullptr && (!mustBeDeleted || f->isDeleted())) {
+            if (f->getNumParams() == n) {
                 bool hasSB = false;
                 for (unsigned i = 0; i != n; ++i) {
                     QualType t1 { decl->getParamDecl(i)->getType() };
                     bool isSB = isSalBool(t1);
                     bool isSBRef = !isSB && t1->isReferenceType()
                         && isSalBool(t1.getNonReferenceType());
-                    QualType t2 { m->getParamDecl(i)->getType() };
+                    QualType t2 { f->getParamDecl(i)->getType() };
                     if (!(isSB
                           ? t2->isBooleanType()
                           : isSBRef
@@ -286,8 +282,8 @@ bool SalBool::VisitParmVarDecl(ParmVarDecl const * decl) {
                               f->getNameInfo().getLoc()))
                       && (!f->isInlined() || f->hasAttr<DeprecatedAttr>()
                           || decl->getType()->isReferenceType()
-                          || hasBoolOverload(f)))
-                  || f->isDeleted()))
+                          || hasBoolOverload(f, false)))
+                  || f->isDeleted() || hasBoolOverload(f, true)))
             {
                 OverrideKind k = getOverrideKind(f);
                 if (k != OverrideKind::YES) {
diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx
index 09b1d01..463ab07 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -113,6 +113,8 @@ void writeData_(oslFileHandle handle, char const * begin, sal_Int32 length) {
     }
 }
 
+void writeValueContent_(oslFileHandle, bool) SAL_DELETED_FUNCTION;
+    // silence lopluign:salbool
 void writeValueContent_(oslFileHandle handle, sal_Bool value) {
     if (value) {
         writeData_(handle, RTL_CONSTASCII_STRINGPARAM("true"));


More information about the Libreoffice-commits mailing list