summaryrefslogtreecommitdiff
path: root/xmlreader/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-07 10:38:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-08 08:30:46 +0200
commit266303e867fae0eb10fe9aa52cf683e3db88376a (patch)
treed2facfb7968b8aa2b69d2ac33f2ed1b0df9d185f /xmlreader/source
parentc5e9bc71c4803ccf7c1eaa23aed03bdaee31f001 (diff)
cleanups in xmlreader
(*) fix order of headers (*) include the right headers in span.hxx (*) use std::memcmp instead of memcmp (*) clear entries from cache when the namespaces array is resized Change-Id: I04319bbaa84369e5470799578fadcda66a591c9f Reviewed-on: https://gerrit.libreoffice.org/80347 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlreader/source')
-rw-r--r--xmlreader/source/xmlreader.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmlreader/source/xmlreader.cxx b/xmlreader/source/xmlreader.cxx
index 95a27a785b5c..918f42a2e1b2 100644
--- a/xmlreader/source/xmlreader.cxx
+++ b/xmlreader/source/xmlreader.cxx
@@ -714,7 +714,11 @@ XmlReader::Result XmlReader::handleEndTag() {
void XmlReader::handleElementEnd() {
assert(!elements_.empty());
- namespaces_.resize(elements_.top().inheritedNamespaces);
+ // remove keys from cache that are no longer valid
+ auto end = elements_.top().inheritedNamespaces;
+ for (auto i = end; i < namespaces_.size(); ++i)
+ cacheNSIds_.erase(namespaces_[i].prefix);
+ namespaces_.resize(end);
elements_.pop();
state_ = elements_.empty() ? State::Done : State::Content;
}