summaryrefslogtreecommitdiff
path: root/xmloff/source/chart
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 /xmloff/source/chart
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 'xmloff/source/chart')
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx2
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index f06936d9139a..e5f677f3fa0e 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -337,7 +337,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
{
OUString sClassName;
sal_uInt16 nClassPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName(
+ GetImport().GetNamespaceMap().GetKeyByAttrValueQName(
aValue, &sClassName );
if( XML_NAMESPACE_CHART == nClassPrefix )
{
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index 11cea543d7d7..32f84b0feae1 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -330,7 +330,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
{
OUString aClassName;
sal_uInt16 nClassPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName(
+ GetImport().GetNamespaceMap().GetKeyByAttrValueQName(
aValue, &aClassName );
if( XML_NAMESPACE_CHART == nClassPrefix )
maSeriesChartTypeName = SchXMLTools::GetChartTypeByClassName( aClassName, false /* bUseOldNames */ );