diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-09-07 22:14:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-09-08 09:07:29 +0200 |
commit | 9208eab706bfffec306d3611080b86b7bdd27567 (patch) | |
tree | ba27eef15834ea2c2545521fd27801c7d8d0ba32 /sw/source/filter/xml | |
parent | 5989ffe70942af036974b70c9e0ecd67978c6cc6 (diff) |
fix crashtest ooo53770-1.odt
Change-Id: I0a3a63e8c4146c2f8a9ac6593774e6e4d9f5b8ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102201
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/xml')
-rw-r--r-- | sw/source/filter/xml/xmlimpit.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
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 <sal/log.hxx> #include <sax/tools/converter.hxx> #include <utility> #include <xmloff/xmluconv.hxx> @@ -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); } } } |