summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-11-25 14:15:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-11-26 21:49:01 +0100
commit508dce40f8fda55767b9f78251725e225db2bd2f (patch)
tree002993a13640f5b1c27ac33cd4836b0cced66501 /sax
parentc8afb4000f178badaf63c2f38fd3fbc12ec832f3 (diff)
xmloff,sw: fix handling of invalid attribute with multiple ':'
ooo53770-1.odt contains an invalid attribute style:style:use-optimal-row-height, which was round-tripped as an unknown attribute, triggering the assert in CheckValidName(). This reveals a confusing mess of SvXMLNamespaceMap::GetKeyByAttrName functions. The bCache flag for one of them was accidentally inverted in commit 78f0d15893c56d7368ddd7ded4e70f2a3bb9d2f4 "loplugin:constantparam in xmloff/" There are basically 2 use cases for this: * XML element and attribute names, which are XML QName and contain at most 1 ':' * XML attribute values, which are namespace-prefixed and may contain any number of ':' in the "local" part of the value Because caching is explicitly disabled for Calc formulas, just resolve the inconsistent bCache by always caching element and attribute names, and never caching attribute values, so we need just 1 flag. Change-Id: I363ea2229d0bf5c7199d61b0fee0d9f168911bfa Reviewed-on: https://gerrit.libreoffice.org/83619 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sax')
-rw-r--r--sax/source/expatwrap/saxwriter.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index 7eb599a5cfc6..552447dda2e6 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -578,6 +578,7 @@ void CheckValidName(OUString const& rName)
auto const c(rName[i]);
if (c == ':')
{
+ // see https://www.w3.org/TR/REC-xml-names/#ns-qualnames
assert(!hasColon && "only one colon allowed");
hasColon = true;
}