summaryrefslogtreecommitdiff
path: root/xmlreader
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-31 12:05:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-14 11:51:44 +0200
commitb0de7bc428aaf914a836da3c33b123e4195e603e (patch)
treeb5d83694bab8f9958281f9b382b2d5731d8f7263 /xmlreader
parent5d5ac2fd9e8fe4781d6175eb58b949ba9c25d564 (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 'xmlreader')
-rw-r--r--xmlreader/source/xmlreader.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/xmlreader/source/xmlreader.cxx b/xmlreader/source/xmlreader.cxx
index 1c6bc45bb339..d6fe61f8363f 100644
--- a/xmlreader/source/xmlreader.cxx
+++ b/xmlreader/source/xmlreader.cxx
@@ -86,8 +86,8 @@ XmlReader::XmlReader(OUString const & fileUrl)
throw css::uno::RuntimeException(
"cannot mmap " + fileUrl_ + " (" + OUString::number(e) + ")" );
}
- namespaceIris_.push_back(Span("http://www.w3.org/XML/1998/namespace"));
- namespaces_.push_back(NamespaceData(Span("xml"), NAMESPACE_XML));
+ namespaceIris_.emplace_back("http://www.w3.org/XML/1998/namespace");
+ namespaces_.emplace_back(Span("xml"), NAMESPACE_XML);
pos_ = static_cast< char * >(fileAddress_);
end_ = pos_ + fileSize_;
state_ = State::Content;
@@ -120,7 +120,7 @@ int XmlReader::registerNamespaceIri(Span const & iri) {
// those files during migration would fail without this hack that can be
// removed once migration is no longer relevant (see
// configmgr::Components::parseModificationLayer):
- namespaces_.push_back(NamespaceData(Span("xsi"), id));
+ namespaces_.emplace_back(Span("xsi"), id);
}
return id;
}
@@ -646,15 +646,13 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) {
Span(attrNameBegin, attrNameColon - attrNameBegin).equals(
"xmlns"))
{
- namespaces_.push_back(
- NamespaceData(
+ namespaces_.emplace_back(
Span(attrNameColon + 1, attrNameEnd - (attrNameColon + 1)),
- scanNamespaceIri(valueBegin, valueEnd)));
+ scanNamespaceIri(valueBegin, valueEnd));
} else {
- attributes_.push_back(
- AttributeData(
+ attributes_.emplace_back(
attrNameBegin, attrNameEnd, attrNameColon, valueBegin,
- valueEnd));
+ valueEnd);
}
}
if (!hasDefaultNs && !elements_.empty()) {