From 9208eab706bfffec306d3611080b86b7bdd27567 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 7 Sep 2020 22:14:55 +0200 Subject: fix crashtest ooo53770-1.odt Change-Id: I0a3a63e8c4146c2f8a9ac6593774e6e4d9f5b8ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102201 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/filter/xml/xmlimpit.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sw/source/filter/xml') diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index be7ffaa95b8f..af8a8b0c2781 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -19,6 +19,7 @@ #include "xmlimpit.hxx" +#include #include #include #include @@ -226,8 +227,12 @@ void SvXMLImportItemMapper::importXMLUnknownAttributes( SfxItemSet& rSet, sPrefix = sName.copy(0, i-1); sName = sName.copy(i+1); } - pUnknownItem->AddAttr( sPrefix, rAttribute.NamespaceURL, sName, - rAttribute.Value ); + // the sax parser doesn't reject these, strangely + if (sName.indexOf(':') == -1) + pUnknownItem->AddAttr( sPrefix, rAttribute.NamespaceURL, sName, + rAttribute.Value ); + else + SAL_WARN("sw", "ignoring dodgy attribute: " + rAttribute.Name); } } } -- cgit