sw/source/filter/ww8/docxexport.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit 09775c1806e9dd32eee8aeff96609186368cb0e7 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Mon Feb 24 15:20:20 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Feb 25 21:25:12 2020 +0100 sw: DOCX export: limit FORMDROPDOWN listEntry to Word's abilities In theory wml.xsd says: <xsd:element name="listEntry" type="CT_String" minOccurs="0" maxOccurs="unbounded"/> In practice Word 2013 refuses to load a file with 26 listEntry in one FORMDROPDOWN field. Interestingly w:result w:val larger than the number of entries does not cause Word to complain. Go figure. Change-Id: I3a61533f9ee4ba3917a9c3bc55a483fd587f0471 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89358 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit d9634e3c9bfaf826b3d4d39e9a57d6c2d8d9a3dc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89432 Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 312500a4502c..d025d6b712ec 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -358,12 +358,13 @@ void DocxExport::DoComboBox(const OUString& rName, m_pDocumentFS->singleElementNS(XML_w, XML_result, FSNS(XML_w, XML_val), OString::number(nId)); - // Loop over the entries - - for (const auto& rItem : rListItems) + // unfortunately Word 2013 refuses to load DOCX with more than 25 listEntry + SAL_WARN_IF(25 < rListItems.getLength(), "sw.ww8", "DocxExport::DoComboBox data loss with more than 25 entries"); + auto const nSize(std::min(sal_Int32(25), rListItems.getLength())); + for (auto i = 0; i < nSize; ++i) { m_pDocumentFS->singleElementNS( XML_w, XML_listEntry, - FSNS( XML_w, XML_val ), rItem.toUtf8() ); + FSNS(XML_w, XML_val), rListItems[i].toUtf8() ); } m_pDocumentFS->endElementNS( XML_w, XML_ddList ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits