xmloff/source/xforms/xformsexport.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
New commits: commit 601cd8dcb0a856c1892af4139bec6991cba6db5b Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Jun 12 17:00:41 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Jun 12 21:18:46 2020 +0200 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 <caol...@redhat.com> 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); } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits