[Libreoffice-commits] core.git: 2 commits - sc/qa xmlsecurity/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Mon Feb 20 06:04:24 UTC 2017


 sc/qa/unit/ucalc_pivottable.cxx                                       |    4 ++--
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 696479aafa6c43daf95c39755f8ce6b772b3938e
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Sun Feb 19 22:44:02 2017 +0100

    cppcheck: redundantAssignment
    
    Change-Id: I4537ced9dafb5b20dbf8cfb7d335698536067c49
    Reviewed-on: https://gerrit.libreoffice.org/34436
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 710191c..14fb71d 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -808,13 +808,13 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::verifyCertificate(
     sal_Int32 validity = 0;
     PCCERT_CHAIN_CONTEXT pChainContext = nullptr;
     PCCERT_CONTEXT pCertContext = nullptr;
-    const X509Certificate_MSCryptImpl* xcert = nullptr;
 
     Reference< XUnoTunnel > xCertTunnel( aCert, UNO_QUERY_THROW ) ;
 
     SAL_INFO("xmlsecurity.xmlsec", "Start verification of certificate: " << aCert->getSubjectName());
 
-    xcert = reinterpret_cast<X509Certificate_MSCryptImpl*>(xCertTunnel->getSomething( X509Certificate_MSCryptImpl::getUnoTunnelId() ));
+    auto xcert = reinterpret_cast<const X509Certificate_MSCryptImpl*>
+            (xCertTunnel->getSomething( X509Certificate_MSCryptImpl::getUnoTunnelId() ));
     if( xcert == nullptr ) {
         throw RuntimeException() ;
     }
commit f173262024391af6cbeac180f8628d0022a22426
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Sun Feb 19 22:40:57 2017 +0100

    cppcheck: redundantAssignment and unreadVariable
    
    Change-Id: I19e8aef9149154967a5a1ba32e3d8e0a918adeaf
    Reviewed-on: https://gerrit.libreoffice.org/34437
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx
index 2c2cfb5..b2ca97a 100644
--- a/sc/qa/unit/ucalc_pivottable.cxx
+++ b/sc/qa/unit/ucalc_pivottable.cxx
@@ -2430,7 +2430,6 @@ void Test::testPivotTableDPCollection()
     ScRange aDataRange(nCol1, nRow1, 0, nCol2, nRow2, 0);
 
     ScDPCollection* pDPs = m_pDoc->GetDPCollection();
-    bool bSuccess = false;
 
     // Check at the beginning
     CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be no DP table", size_t(0), pDPs->GetCount());
@@ -2442,7 +2441,7 @@ void Test::testPivotTableDPCollection()
 
     // Add 2 DP objects
     ScDPObject* pDPObj = createDPFromRange(m_pDoc, aDataRange , aFields, nFieldCount, false);
-    bSuccess = pDPs->InsertNewTable(pDPObj);
+    bool bSuccess = pDPs->InsertNewTable(pDPObj);
     CPPUNIT_ASSERT_MESSAGE("failed to insert a new DP object into document", bSuccess);
     pDPObj->SetName("DP1"); // set custom name
 
@@ -2563,6 +2562,7 @@ void Test::testPivotTableMedianFunc()
     }
 
     bSuccess = aFunc.RemovePivotTable(*pDPObject, false, true);
+    CPPUNIT_ASSERT_MESSAGE("Failed to remove pivot table object.", bSuccess);
 
     m_pDoc->DeleteTab(1);
     m_pDoc->DeleteTab(0);


More information about the Libreoffice-commits mailing list