sw/qa/extras/ooxmlexport/data/tdf136441_commentInFootnote.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 6 ++++++ sw/source/filter/ww8/wrtw8nds.cxx | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-)
New commits: commit 870bb98b3a1159e31895524ef54457db37d1b9af Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Sat Sep 5 13:38:04 2020 +0300 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Sat Sep 5 16:39:48 2020 +0200 tdf#136441 ms export: don't export comments in footnotes Microsoft UI does not allow comments in footnotes, or in headers/footers, or endnotes, so just throw them away for all MS formats. This avoids the biggest problem, which was an error in LO reading the DOCX. Prior to this bug fix, the status was: DOCX: Word 2016 opens it ok, but no comment in footnote. Word 2003 hangs. LO loads but has a SAX error the user must ignore, and no comment seen in the footnote anyway. DOC: Word 2016 opens, but misses the main body text, and of course no comment in footnote. Word 2003 opens, sees the main body text just fine, and no comment in footnote. LO loads, but no comment seen in footnote anyway. RTF: Word 2016/2003 open, and no comment in footnote. LO loads, but no comment seen in footnote anyway. If the SAX error problem could be fixed, then perhaps it would be worth allowing LO to export comments to DOCX for its own benefit. In that case, allow case SwFieldIds::Postit: PostitField( pField ); This patch does not fix the problem where the body text is missing in Word 2016 in DOC format. Change-Id: I0b7389616a2207d41ae525dbc0b2eea536364d90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102074 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/qa/extras/ooxmlexport/data/tdf136441_commentInFootnote.odt b/sw/qa/extras/ooxmlexport/data/tdf136441_commentInFootnote.odt new file mode 100644 index 000000000000..61c9632b3972 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf136441_commentInFootnote.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 8d6e8228f8ba..4e39a5af0297 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -478,6 +478,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135329_lostImage, "tdf135329_lostImage.odt") uno::Reference<beans::XPropertySet> xImageProps(getShape(2), uno::UNO_QUERY_THROW); } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf136441_commentInFootnote, "tdf136441_commentInFootnote.odt") +{ + // failed to load without error if footnote contained a comment. + // (MS Word's UI doesn't allow adding comments to a footnote.) +} + DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx") { CPPUNIT_ASSERT_EQUAL(2, getPages()); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index a1f8965b686e..11f8b88059c5 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2374,7 +2374,9 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) // Append bookmarks in this range after flys, exclusive of final // position of this range AppendBookmarks( rNode, nCurrentPos, nNextAttr - nCurrentPos ); - AppendAnnotationMarks(aAttrIter, nCurrentPos, nNextAttr - nCurrentPos); + //Sadly only possible for word in main document text + if ( m_nTextTyp == TXT_MAINTEXT ) + AppendAnnotationMarks(aAttrIter, nCurrentPos, nNextAttr - nCurrentPos); // At the moment smarttags are only written for paragraphs, at the // beginning of the paragraph. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits