diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-04-04 08:57:19 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-04-04 09:11:51 +0000 |
commit | 4e444871a4c9d819c136b383c81b7f7df386a78d (patch) | |
tree | e13952b0da7c2d615380b26d9df1e56dd7d6f20d /xmlsecurity | |
parent | loplugin:constantparam in svx (diff) | |
download | core-4e444871a4c9d819c136b383c81b7f7df386a78d.tar.gz core-4e444871a4c9d819c136b383c81b7f7df386a78d.zip |
Use std::size_t
And include <cstddef> where necessary.
Change-Id: Icc1208528d6a8b04375d55ccbf3cd6ef046b454f
Reviewed-on: https://gerrit.libreoffice.org/23796
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/qa/unit/signing/signing.cxx | 16 | ||||
-rw-r--r-- | xmlsecurity/source/helper/documentsignaturemanager.cxx | 20 |
2 files changed, 18 insertions, 18 deletions
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index 0090015121dd..83fdd8d8aa5f 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -172,7 +172,7 @@ void SigningTest::testDescription() // Read back the signature and make sure that the description survives the roundtrip. aManager.read(/*bUseTempStream=*/true); std::vector<SignatureInformation>& rInformations = aManager.maCurrentSignatureInformations; - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rInformations.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), rInformations.size()); CPPUNIT_ASSERT_EQUAL(aDescription, rInformations[0].ouDescription); } @@ -205,7 +205,7 @@ void SigningTest::testOOXMLDescription() // Read back the signature and make sure that the description survives the roundtrip. aManager.read(/*bUseTempStream=*/true); std::vector<SignatureInformation>& rInformations = aManager.maCurrentSignatureInformations; - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rInformations.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), rInformations.size()); CPPUNIT_ASSERT_EQUAL(aDescription, rInformations[0].ouDescription); } @@ -226,7 +226,7 @@ void SigningTest::testOOXMLAppend() aManager.maSignatureHelper.SetStorage(xStorage, "1.2"); aManager.read(/*bUseTempStream=*/false); std::vector<SignatureInformation>& rInformations = aManager.maCurrentSignatureInformations; - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rInformations.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), rInformations.size()); // Then add a second document signature. uno::Reference<security::XCertificate> xCertificate = getCertificate(aManager.maSignatureHelper); @@ -237,7 +237,7 @@ void SigningTest::testOOXMLAppend() // Read back the signatures and make sure that we have the expected amount. aManager.read(/*bUseTempStream=*/true); // This was 1: the original signature was lost. - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rInformations.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(2), rInformations.size()); } void SigningTest::testOOXMLRemove() @@ -252,7 +252,7 @@ void SigningTest::testOOXMLRemove() aManager.maSignatureHelper.SetStorage(xStorage, "1.2"); aManager.read(/*bUseTempStream=*/false); std::vector<SignatureInformation>& rInformations = aManager.maCurrentSignatureInformations; - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rInformations.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(2), rInformations.size()); // Then remove the last added signature. uno::Reference<security::XCertificate> xCertificate = getCertificate(aManager.maSignatureHelper); @@ -261,7 +261,7 @@ void SigningTest::testOOXMLRemove() // Read back the signatures and make sure that only purpose1 is left. aManager.read(/*bUseTempStream=*/true); - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rInformations.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), rInformations.size()); CPPUNIT_ASSERT_EQUAL(OUString("purpose1"), rInformations[0].ouDescription); } @@ -282,7 +282,7 @@ void SigningTest::testOOXMLRemoveAll() aManager.maSignatureHelper.SetStorage(xStorage, "1.2"); aManager.read(/*bUseTempStream=*/false); std::vector<SignatureInformation>& rInformations = aManager.maCurrentSignatureInformations; - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rInformations.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), rInformations.size()); // Then remove the only signature in the document. uno::Reference<security::XCertificate> xCertificate = getCertificate(aManager.maSignatureHelper); @@ -292,7 +292,7 @@ void SigningTest::testOOXMLRemoveAll() aManager.write(); // Make sure that the signature count is zero and the whole signature storage is removed completely. - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), rInformations.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(0), rInformations.size()); uno::Reference<container::XNameAccess> xNameAccess(xStorage, uno::UNO_QUERY); CPPUNIT_ASSERT(!xNameAccess->hasByName("_xmlsignatures")); diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx index 47d416ffa8b5..3c8f7d596b03 100644 --- a/xmlsecurity/source/helper/documentsignaturemanager.cxx +++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx @@ -249,8 +249,8 @@ bool DocumentSignatureManager::add(const uno::Reference<security::XCertificate>& // Export old signatures... uno::Reference<xml::sax::XDocumentHandler> xDocumentHandler(xSaxWriter, uno::UNO_QUERY_THROW); - size_t nInfos = maCurrentSignatureInformations.size(); - for (size_t n = 0; n < nInfos; n++) + std::size_t nInfos = maCurrentSignatureInformations.size(); + for (std::size_t n = 0; n < nInfos; n++) XMLSignatureHelper::ExportSignature(xDocumentHandler, maCurrentSignatureInformations[n]); // Create a new one... @@ -270,7 +270,7 @@ bool DocumentSignatureManager::add(const uno::Reference<security::XCertificate>& maSignatureHelper.ExportSignatureRelations(aStreamHelper.xSignatureStorage, nSignatureCount); // Export old signatures. - for (size_t i = 0; i < maCurrentSignatureInformations.size(); ++i) + for (std::size_t i = 0; i < maCurrentSignatureInformations.size(); ++i) maSignatureHelper.ExportOOXMLSignature(mxStore, aStreamHelper.xSignatureStorage, maCurrentSignatureInformations[i], i + 1); // Create a new signature. @@ -303,8 +303,8 @@ void DocumentSignatureManager::remove(sal_uInt16 nPosition) uno::Reference<xml::sax::XWriter> xSaxWriter = maSignatureHelper.CreateDocumentHandlerWithHeader(xOutputStream); uno::Reference< xml::sax::XDocumentHandler> xDocumentHandler(xSaxWriter, uno::UNO_QUERY_THROW); - size_t nInfos = maCurrentSignatureInformations.size(); - for (size_t n = 0 ; n < nInfos ; ++n) + std::size_t nInfos = maCurrentSignatureInformations.size(); + for (std::size_t n = 0 ; n < nInfos ; ++n) XMLSignatureHelper::ExportSignature(xDocumentHandler, maCurrentSignatureInformations[n]); XMLSignatureHelper::CloseDocumentHandler(xDocumentHandler); @@ -318,7 +318,7 @@ void DocumentSignatureManager::remove(sal_uInt16 nPosition) maSignatureHelper.ExportSignatureRelations(aStreamHelper.xSignatureStorage, nSignatureCount); // Export old signatures. - for (size_t i = 0; i < maCurrentSignatureInformations.size(); ++i) + for (std::size_t i = 0; i < maCurrentSignatureInformations.size(); ++i) maSignatureHelper.ExportOOXMLSignature(mxStore, aStreamHelper.xSignatureStorage, maCurrentSignatureInformations[i], i + 1); // Flush objects. @@ -363,8 +363,8 @@ void DocumentSignatureManager::write() uno::Reference<xml::sax::XWriter> xSaxWriter = maSignatureHelper.CreateDocumentHandlerWithHeader(xOutputStream); uno::Reference< xml::sax::XDocumentHandler> xDocumentHandler(xSaxWriter, uno::UNO_QUERY_THROW); - size_t nInfos = maCurrentSignatureInformations.size(); - for (size_t n = 0 ; n < nInfos ; ++n) + std::size_t nInfos = maCurrentSignatureInformations.size(); + for (std::size_t n = 0 ; n < nInfos ; ++n) XMLSignatureHelper::ExportSignature(xDocumentHandler, maCurrentSignatureInformations[n]); XMLSignatureHelper::CloseDocumentHandler(xDocumentHandler); @@ -373,7 +373,7 @@ void DocumentSignatureManager::write() else if (aStreamHelper.xSignatureStorage.is() && aStreamHelper.nStorageFormat == embed::StorageFormats::OFOPXML) { // OOXML - size_t nSignatureCount = maCurrentSignatureInformations.size(); + std::size_t nSignatureCount = maCurrentSignatureInformations.size(); maSignatureHelper.ExportSignatureContentTypes(mxStore, nSignatureCount); if (nSignatureCount > 0) maSignatureHelper.ExportSignatureRelations(aStreamHelper.xSignatureStorage, nSignatureCount); @@ -386,7 +386,7 @@ void DocumentSignatureManager::write() mxStore->removeElement("_xmlsignatures"); } - for (size_t i = 0; i < nSignatureCount; ++i) + for (std::size_t i = 0; i < nSignatureCount; ++i) maSignatureHelper.ExportOOXMLSignature(mxStore, aStreamHelper.xSignatureStorage, maCurrentSignatureInformations[i], i + 1); } |