[Libreoffice-commits] core.git: 5 commits - include/cppu include/salhelper include/typelib include/uno qadevOOo/runner

Stephan Bergmann sbergman at redhat.com
Tue Jan 28 06:55:09 PST 2014


 include/cppu/EnvGuards.hxx                   |    2 +-
 include/salhelper/dynload.hxx                |    2 +-
 include/salhelper/timer.hxx                  |   16 ++++++++--------
 include/typelib/typedescription.hxx          |    8 ++++----
 include/uno/environment.hxx                  |    2 +-
 include/uno/mapping.hxx                      |    6 +++---
 qadevOOo/runner/util/AccessibilityTools.java |    6 ++++--
 7 files changed, 22 insertions(+), 20 deletions(-)

New commits:
commit fcf996f893ffd955ed56ea71e2ad7cf0194bb505
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 28 13:44:24 2014 +0100

    uno: Let C++ inline functions return bool instead of sal_Bool
    
    ...to improve diagnosing misuses of boolean expressions in client code (cf.
    compilerplugins/clang/implicitboolconversion.cxx).  This change should be
    transparent to client code.
    
    Change-Id: Id4f3c7159c5cfac56dd9edf4d1a43e36eed39fec

diff --git a/include/uno/environment.hxx b/include/uno/environment.hxx
index 0f4d15b..1eb5a2e 100644
--- a/include/uno/environment.hxx
+++ b/include/uno/environment.hxx
@@ -133,7 +133,7 @@ public:
 
         @return true, if a environment is set, false otherwise
     */
-    inline sal_Bool SAL_CALL is() const SAL_THROW(())
+    inline bool SAL_CALL is() const SAL_THROW(())
         { return (_pEnv != 0); }
 
     /** Releases a set environment.
diff --git a/include/uno/mapping.hxx b/include/uno/mapping.hxx
index f882817..c562129 100644
--- a/include/uno/mapping.hxx
+++ b/include/uno/mapping.hxx
@@ -138,7 +138,7 @@ public:
 
         @return true if a mapping is set
     */
-    inline sal_Bool SAL_CALL is() const SAL_THROW(())
+    inline bool SAL_CALL is() const SAL_THROW(())
         { return (_pMapping != 0); }
 
     /** Releases a set mapping.
@@ -303,7 +303,7 @@ inline void * Mapping::mapInterface(
     @deprecated
 */
 template< class C >
-inline sal_Bool mapToCpp( Reference< C > * ppRet, uno_Interface * pUnoI ) SAL_THROW(())
+inline bool mapToCpp( Reference< C > * ppRet, uno_Interface * pUnoI ) SAL_THROW(())
 {
     Mapping aMapping(
         ::rtl::OUString( UNO_LB_UNO ),
@@ -326,7 +326,7 @@ inline sal_Bool mapToCpp( Reference< C > * ppRet, uno_Interface * pUnoI ) SAL_TH
     @deprecated
 */
 template< class C >
-inline sal_Bool mapToUno( uno_Interface ** ppRet, const Reference< C > & x ) SAL_THROW(())
+inline bool mapToUno( uno_Interface ** ppRet, const Reference< C > & x ) SAL_THROW(())
 {
     Mapping aMapping(
         ::rtl::OUString( CPPU_CURRENT_LANGUAGE_BINDING_NAME ),
commit 8f408fd559a8843b9a0f5a5d40223485e3a9deab
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 28 13:16:14 2014 +0100

    salhelper: Let C++ inline functions return bool instead of sal_Bool
    
    ...to improve diagnosing misuses of boolean expressions in client code (cf.
    compilerplugins/clang/implicitboolconversion.cxx).  This change should be
    transparent to client code.
    
    Change-Id: I2c7779ad07daa77ae06709c1f6512f2fa25fcd36

diff --git a/include/salhelper/dynload.hxx b/include/salhelper/dynload.hxx
index 826a217..35eb811 100644
--- a/include/salhelper/dynload.hxx
+++ b/include/salhelper/dynload.hxx
@@ -182,7 +182,7 @@ public:
     }
 
     /// checks if the loader works on a loaded and initialized library.
-    sal_Bool SAL_CALL isLoaded() const SAL_THROW(())
+    bool SAL_CALL isLoaded() const SAL_THROW(())
     {
         return (m_pLoader != NULL);
     }
diff --git a/include/salhelper/timer.hxx b/include/salhelper/timer.hxx
index 8043e83..1b52522 100644
--- a/include/salhelper/timer.hxx
+++ b/include/salhelper/timer.hxx
@@ -89,33 +89,33 @@ struct TTimeValue : public TimeValue
         normalize();
     }
 
-    sal_Bool SAL_CALL isEmpty() const
+    bool SAL_CALL isEmpty() const
     {
         return ( ( Seconds == 0 ) && ( Nanosec == 0 ) );
     }
 };
 
-inline sal_Bool operator<( const TTimeValue& rTimeA, const TTimeValue& rTimeB )
+inline bool operator<( const TTimeValue& rTimeA, const TTimeValue& rTimeB )
 {
     if ( rTimeA.Seconds < rTimeB.Seconds )
-        return sal_True;
+        return true;
     else if ( rTimeA.Seconds > rTimeB.Seconds )
-        return sal_False;
+        return false;
     else
         return ( rTimeA.Nanosec < rTimeB.Nanosec );
 }
 
-inline sal_Bool operator>( const TTimeValue& rTimeA, const TTimeValue& rTimeB )
+inline bool operator>( const TTimeValue& rTimeA, const TTimeValue& rTimeB )
 {
     if ( rTimeA.Seconds > rTimeB.Seconds )
-        return sal_True;
+        return true;
     else if ( rTimeA.Seconds < rTimeB.Seconds )
-        return sal_False;
+        return false;
     else
         return ( rTimeA.Nanosec > rTimeB.Nanosec );
 }
 
-inline sal_Bool operator==( const TTimeValue& rTimeA, const TTimeValue& rTimeB )
+inline bool operator==( const TTimeValue& rTimeA, const TTimeValue& rTimeB )
 {
     return ( ( rTimeA.Seconds == rTimeB.Seconds ) &&
              ( rTimeA.Nanosec == rTimeB.Nanosec ) );
commit e2e5b7499330f75dc5fb6e42c96555cbd15ed807
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 28 12:46:06 2014 +0100

    Explicit null check
    
    Seen this cause JunitTest_sc_unoapi once with a NullPointerException, though I
    do not know whether ac can legitimately be null here.
    
    Change-Id: I1ca40dfca2d1a597842fba011a813be8154d8dd8

diff --git a/qadevOOo/runner/util/AccessibilityTools.java b/qadevOOo/runner/util/AccessibilityTools.java
index 85cd442..1b59b25 100644
--- a/qadevOOo/runner/util/AccessibilityTools.java
+++ b/qadevOOo/runner/util/AccessibilityTools.java
@@ -110,7 +110,9 @@ public class AccessibilityTools {
     public static XAccessibleContext getAccessibleObjectForRoleIgnoreShowing_(XAccessible xacc,
         short role) {
         XAccessibleContext ac = xacc.getAccessibleContext();
-
+        if (ac == null) {
+            return null;
+        }
         if (ac.getAccessibleRole() == role) {
             SearchedAccessible = xacc;
             return ac;
@@ -443,4 +445,4 @@ public class AccessibilityTools {
     private static void logging(PrintWriter log, String content){
         if (debug) log.println(content);
     }
-}
\ No newline at end of file
+}
commit fef7cbd5d5057fb88e46f967739447cf26c00b8e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 28 12:45:30 2014 +0100

    cppu: Let C++ inline functions return bool instead of sal_Bool
    
    ...to improve diagnosing misuses of boolean expressions in client code (cf.
    compilerplugins/clang/implicitboolconversion.cxx).  This change should be
    transparent to client code.
    
    Change-Id: I4c9a55f8c7d0f05fda617f9b33d93ce78bb8fbeb

diff --git a/include/cppu/EnvGuards.hxx b/include/cppu/EnvGuards.hxx
index 01039a2..68d81ff 100644
--- a/include/cppu/EnvGuards.hxx
+++ b/include/cppu/EnvGuards.hxx
@@ -59,7 +59,7 @@ namespace cppu
 
             @return  0 == empty, 1 == non empty
         */
-        sal_Bool SAL_CALL is() const SAL_THROW(())
+        bool SAL_CALL is() const SAL_THROW(())
         {
             return m_env.is();
         }
commit fd910cfbda17dd6cded63128fa4dbbc931d2f04d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 28 12:17:00 2014 +0100

    typelib: Let C++ inline functions return bool instead of sal_Bool
    
    ...to improve diagnosing misuses of boolean expressions in client code (cf.
    compilerplugins/clang/implicitboolconversion.cxx).  This change should be
    transparent to client code.
    
    Change-Id: Ie011e52f6cb022fd1d24f6a872037f3023060247

diff --git a/include/typelib/typedescription.hxx b/include/typelib/typedescription.hxx
index 0db15ff..9ac0db9 100644
--- a/include/typelib/typedescription.hxx
+++ b/include/typelib/typedescription.hxx
@@ -111,13 +111,13 @@ public:
         @param pTypeDescr another type description
         @return true, if both type descriptions are equal, false otherwise
     */
-    inline sal_Bool SAL_CALL equals( const typelib_TypeDescription * pTypeDescr ) const SAL_THROW(());
+    inline bool SAL_CALL equals( const typelib_TypeDescription * pTypeDescr ) const SAL_THROW(());
     /** Tests whether two type descriptions are equal.
 
         @param rTypeDescr another type description
         @return true, if both type descriptions are equal, false otherwise
     */
-    inline sal_Bool SAL_CALL equals( const TypeDescription & rTypeDescr ) const SAL_THROW(())
+    inline bool SAL_CALL equals( const TypeDescription & rTypeDescr ) const SAL_THROW(())
         { return equals( rTypeDescr._pTypeDescr ); }
 
     /** Makes stored type description complete.
@@ -134,7 +134,7 @@ public:
 
         @return true, if a type description is set, false otherwise
     */
-    inline sal_Bool SAL_CALL is() const SAL_THROW(())
+    inline bool SAL_CALL is() const SAL_THROW(())
         { return (_pTypeDescr != 0); }
 };
 //__________________________________________________________________________________________________
@@ -194,7 +194,7 @@ inline TypeDescription & TypeDescription::operator = ( typelib_TypeDescription *
     return *this;
 }
 //__________________________________________________________________________________________________
-inline sal_Bool TypeDescription::equals( const typelib_TypeDescription * pTypeDescr ) const SAL_THROW(())
+inline bool TypeDescription::equals( const typelib_TypeDescription * pTypeDescr ) const SAL_THROW(())
 {
     return (_pTypeDescr && pTypeDescr &&
             typelib_typedescription_equals( _pTypeDescr, pTypeDescr ));


More information about the Libreoffice-commits mailing list