summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-09-05 13:38:04 +0300
committerJustin Luth <justin_luth@sil.org>2020-09-05 16:39:48 +0200
commit870bb98b3a1159e31895524ef54457db37d1b9af (patch)
treef5c7920482a475c7c10903a060c7e8a3e29162b0 /sw/source/filter/ww8
parentd1708ea5ef42daea49368d159324a4ba11256e55 (diff)
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_luth@sil.org>
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx4
1 files changed, 3 insertions, 1 deletions
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.