[Libreoffice-commits] core.git: 3 commits - vcl/source xmloff/source xmlsecurity/source

Caolán McNamara caolanm at redhat.com
Thu Feb 26 06:46:13 PST 2015


 vcl/source/window/mnemonic.cxx                                |   37 ----------
 xmloff/source/style/xmlbahdl.cxx                              |   17 ----
 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx |    7 -
 3 files changed, 6 insertions(+), 55 deletions(-)

New commits:
commit 11bed72b2a0c3f51dde4733875486a5c181902ef
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 26 14:33:07 2015 +0000

    cppcheck: unreadVariable
    
    Change-Id: Id4c43a6bcdf915b98410af9ceb0dbf20df3a9498

diff --git a/vcl/source/window/mnemonic.cxx b/vcl/source/window/mnemonic.cxx
index 730e6a2..9ccb441 100644
--- a/vcl/source/window/mnemonic.cxx
+++ b/vcl/source/window/mnemonic.cxx
@@ -287,49 +287,12 @@ OUString MnemonicGenerator::CreateMnemonic( const OUString& _rKey )
                             nIndex--;
                     }
                     rKey = rKey.replaceAt( nIndex, 0, aStr );
-                    bChanged = true;
                     break;
                 }
             }
         }
     }
 
-// #i87415# Duplicates mnemonics are bad for consistent keyboard accessibility
-// It's probably better to not have mnemonics for some widgets, than to have ambiguous ones.
-//    if( ! bChanged )
-//    {
-//        /*
-//         *  #97809# if all else fails use the first character of a word
-//         *  anyway and live with duplicate mnemonics
-//         */
-//        nIndex = 0;
-//        do
-//        {
-//            c = aKey.GetChar( nIndex );
-
-//            nMnemonicIndex = ImplGetMnemonicIndex( c );
-//            if ( nMnemonicIndex != MNEMONIC_INDEX_NOTFOUND )
-//            {
-//                maMnemonics[nMnemonicIndex] = 0;
-//                rKey.Insert( MNEMONIC_CHAR, nIndex );
-//                bChanged = true;
-//                break;
-//            }
-
-//            // Search for next word
-//            do
-//            {
-//                nIndex++;
-//                c = aKey.GetChar( nIndex );
-//                if ( c == ' ' )
-//                    break;
-//            }
-//            while ( nIndex < nLen );
-//            nIndex++;
-//        }
-//        while ( nIndex < nLen );
-//    }
-
     return rKey;
 }
 
commit bcce2502a3c0a8bbb503a5b48de07defe21b09f0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 26 14:19:47 2015 +0000

    cppcheck: redundantAssignment
    
    Change-Id: Iee0fcb8e2b91a6554bedc7e3989c0585a1679a61

diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx
index ac90a0b..bee67a4 100644
--- a/xmloff/source/style/xmlbahdl.cxx
+++ b/xmloff/source/style/xmlbahdl.cxx
@@ -186,12 +186,9 @@ XMLMeasurePropHdl::~XMLMeasurePropHdl()
 
 bool XMLMeasurePropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
 {
-    bool bRet = false;
-
     sal_Int32 nValue = 0;
-    bRet = rUnitConverter.convertMeasureToCore( nValue, rStrImpValue );
+    bool bRet = rUnitConverter.convertMeasureToCore( nValue, rStrImpValue );
     lcl_xmloff_setAny( rValue, nValue, nBytes );
-
     return bRet;
 }
 
@@ -407,7 +404,6 @@ bool XMLNegPercentPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue,
 }
 
 // class XMLMeasurePxPropHdl
-
 XMLMeasurePxPropHdl::~XMLMeasurePxPropHdl()
 {
     // nothing to do
@@ -415,12 +411,9 @@ XMLMeasurePxPropHdl::~XMLMeasurePxPropHdl()
 
 bool XMLMeasurePxPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const
 {
-    bool bRet = false;
-
     sal_Int32 nValue = 0;
-    bRet = ::sax::Converter::convertMeasurePx( nValue, rStrImpValue );
+    bool bRet = ::sax::Converter::convertMeasurePx( nValue, rStrImpValue );
     lcl_xmloff_setAny( rValue, nValue, nBytes );
-
     return bRet;
 }
 
@@ -558,12 +551,8 @@ XMLStringPropHdl::~XMLStringPropHdl()
 
 bool XMLStringPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const
 {
-    bool bRet = false;
-
     rValue <<= rStrImpValue;
-    bRet = true;
-
-    return bRet;
+    return true;
 }
 
 bool XMLStringPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& ) const
commit 44e1eaea6acc248db48a9b6b587baff7d24a6742
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 26 14:14:49 2015 +0000

    cppcheck: variableScope
    
    Change-Id: I2dbab9e972c7470e9bd30692e54c51ee11ffd45b

diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index 8a14ed4..cfa3b8a 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -364,7 +364,6 @@ SecurityEnvironment_NssImpl::getPersonalCertificates() throw( SecurityException
     {
         PK11SlotInfo *slot = *is;
         SECKEYPrivateKeyList* priKeyList ;
-        SECKEYPrivateKeyListNode* curPri ;
 
         if( PK11_NeedLogin(slot ) ) {
             SECStatus nRet = PK11_Authenticate(slot, PR_TRUE, NULL);
@@ -379,9 +378,9 @@ SecurityEnvironment_NssImpl::getPersonalCertificates() throw( SecurityException
         priKeyList = PK11_ListPrivateKeysInSlot(slot) ;
         if( priKeyList != NULL )
         {
-            for( curPri = PRIVKEY_LIST_HEAD( priKeyList );
-                !PRIVKEY_LIST_END( curPri, priKeyList ) && curPri != NULL ;
-                curPri = PRIVKEY_LIST_NEXT( curPri ) )
+            for (SECKEYPrivateKeyListNode* curPri = PRIVKEY_LIST_HEAD(priKeyList);
+                !PRIVKEY_LIST_END( curPri, priKeyList ) && curPri != NULL;
+                curPri = PRIVKEY_LIST_NEXT(curPri))
             {
                 xcert = NssPrivKeyToXCert( curPri->key ) ;
                 if( xcert != NULL )


More information about the Libreoffice-commits mailing list