[Libreoffice-commits] core.git: xmloff/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jun 12 19:19:23 UTC 2020
xmloff/source/xforms/xformsexport.cxx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 601cd8dcb0a856c1892af4139bec6991cba6db5b
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jun 12 17:00:41 2020 +0100
Commit: Caolán McNamara <caolanm at 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 <caolanm at 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);
}
}
}
More information about the Libreoffice-commits
mailing list