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 270604a11022ab4fb9a3ac299d9a42e1d8464c47 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Sat Sep 5 13:38:04 2020 +0300 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Thu Oct 1 10:42:21 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> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103630 Reviewed-by: Michael Stahl <michael.st...@cib.de> 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 ab204e9c5e67..1950b8349697 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -114,6 +114,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135973, "tdf135973.odt") } } +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 ec6f63cb222b..4f3b98089658 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2392,7 +2392,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