diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-06-12 17:00:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-06-12 21:18:46 +0200 |
commit | 601cd8dcb0a856c1892af4139bec6991cba6db5b (patch) | |
tree | 5028fee3cb495a67bd324464109402510f39d739 /xmloff | |
parent | a854500861e469835b8d1fd37ac86b1b514c43a6 (diff) |
crashtesting: assert on reexport of form-submission.odt
Change-Id: Ib239171d7aa9d0e5202025149dca1e0cab4bd2b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96231
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/xforms/xformsexport.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx index f3356c938d07..97fba39e4488 100644 --- a/xmloff/source/xforms/xformsexport.cxx +++ b/xmloff/source/xforms/xformsexport.cxx @@ -345,7 +345,15 @@ void exportXFormsBinding( SvXMLExport& rExport, if( nKey == XML_NAMESPACE_UNKNOWN || rMap.GetNameByKey( nKey ) != sURI ) { - rExport.AddAttribute( "xmlns:" + rPrefix, sURI ); + // add declaration if it doesn't already exist + SvXMLAttributeList& rAttrList = rExport.GetAttrList(); + OUString sName = "xmlns:" + rPrefix; + sal_Int16 nFound = rAttrList.GetIndexByName(sName); + // duplicate xmlns:script, http://openoffice.org/2000/script seen + assert(nFound == -1 || rAttrList.getValueByIndex(nFound) == sURI); + if (nFound != -1) + continue; + rAttrList.AddAttribute(sName, sURI); } } } |