diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-31 12:05:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-14 11:51:44 +0200 |
commit | b0de7bc428aaf914a836da3c33b123e4195e603e (patch) | |
tree | b5d83694bab8f9958281f9b382b2d5731d8f7263 /xmlsecurity | |
parent | 5d5ac2fd9e8fe4781d6175eb58b949ba9c25d564 (diff) |
clang-tidy modernize-use-emplace in various
Change-Id: Id1bbd3f380c17beeaab11f7140d4df1304c3d0d8
Reviewed-on: https://gerrit.libreoffice.org/41750
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/dialogs/resourcemanager.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xmlsignaturehelper.cxx | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/xmlsecurity/source/dialogs/resourcemanager.cxx b/xmlsecurity/source/dialogs/resourcemanager.cxx index 4df58e9868d1..f5a3411e9e76 100644 --- a/xmlsecurity/source/dialogs/resourcemanager.cxx +++ b/xmlsecurity/source/dialogs/resourcemanager.cxx @@ -262,7 +262,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) if (!bInValue) { OSL_ASSERT(!sType.isEmpty()); - retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear())); + retVal.emplace_back(sType, sbufValue.makeStringAndClear()); sType.clear(); //The next char is the start of the new type nTypeNameStart = i + 1; @@ -288,7 +288,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) if (!sbufValue.isEmpty()) { OSL_ASSERT(!sType.isEmpty()); - retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear())); + retVal.emplace_back(sType, sbufValue.makeStringAndClear()); } return retVal; } diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx index f4f61e0fc945..db29cd9a4bcd 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx @@ -432,9 +432,9 @@ void XMLSignatureHelper::EnsureSignaturesRelation(const css::uno::Reference<css: { // No, and have to add one. std::vector<beans::StringPair> aRelation; - aRelation.push_back(beans::StringPair("Id", "rId" + OUString::number(++nCount))); - aRelation.push_back(beans::StringPair("Type", OOXML_SIGNATURE_ORIGIN)); - aRelation.push_back(beans::StringPair("Target", "_xmlsignatures/origin.sigs")); + aRelation.emplace_back("Id", "rId" + OUString::number(++nCount)); + aRelation.emplace_back("Type", OOXML_SIGNATURE_ORIGIN); + aRelation.emplace_back("Target", "_xmlsignatures/origin.sigs"); aRelationsInfo.push_back(comphelper::containerToSequence(aRelation)); } else if (bHaveRelation && !bAdd) @@ -479,9 +479,9 @@ void XMLSignatureHelper::ExportSignatureRelations(const css::uno::Reference<css: for (int i = 0; i < nSignatureCount; ++i) { std::vector<beans::StringPair> aRelation; - aRelation.push_back(beans::StringPair("Id", "rId" + OUString::number(i + 1))); - aRelation.push_back(beans::StringPair("Type", OOXML_SIGNATURE_SIGNATURE)); - aRelation.push_back(beans::StringPair("Target", "sig" + OUString::number(i + 1) + ".xml")); + aRelation.emplace_back("Id", "rId" + OUString::number(i + 1)); + aRelation.emplace_back("Type", OOXML_SIGNATURE_SIGNATURE); + aRelation.emplace_back("Target", "sig" + OUString::number(i + 1) + ".xml"); aRelations.push_back(comphelper::containerToSequence(aRelation)); } comphelper::OFOPXMLHelper::WriteRelationsInfoSequence(xRelStream, comphelper::containerToSequence(aRelations), mxCtx); @@ -508,14 +508,14 @@ void XMLSignatureHelper::ExportSignatureContentTypes(const css::uno::Reference<c return rPair.First == "rels"; }); if (it == rDefaults.end()) - aDefaults.push_back(beans::StringPair("rels", "application/vnd.openxmlformats-package.relationships+xml")); + aDefaults.emplace_back("rels", "application/vnd.openxmlformats-package.relationships+xml"); it = std::find_if(rDefaults.begin(), rDefaults.end(), [](const beans::StringPair& rPair) { return rPair.First == "sigs"; }); if (it == rDefaults.end()) - aDefaults.push_back(beans::StringPair("sigs", "application/vnd.openxmlformats-package.digital-signature-origin")); + aDefaults.emplace_back("sigs", "application/vnd.openxmlformats-package.digital-signature-origin"); rDefaults = comphelper::containerToSequence(aDefaults); // Remove existing signature overrides. @@ -528,7 +528,7 @@ void XMLSignatureHelper::ExportSignatureContentTypes(const css::uno::Reference<c // Add our signature overrides. for (int i = 1; i <= nSignatureCount; ++i) - aOverrides.push_back(beans::StringPair("/_xmlsignatures/sig" + OUString::number(i) + ".xml", "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml")); + aOverrides.emplace_back("/_xmlsignatures/sig" + OUString::number(i) + ".xml", "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml"); rOverrides = comphelper::containerToSequence(aOverrides); uno::Reference<io::XOutputStream> xOutputStream = xStream->getOutputStream(); |