diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-05-22 22:05:24 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-05-23 09:12:06 +0200 |
commit | 5956828c88501ef1366e60010b05053a8e1e642e (patch) | |
tree | 28b6389baca36b8ced4199934cff55a3790510f7 /sw/source/filter/ww8/rtfexport.cxx | |
parent | 4552096794c408110630ab2eaf47bebaa6c403f2 (diff) |
tdf#117505 RTF export: fix incorrect header distance for first/follow pages
In case the first and the follow page format has different header
distances, the DOC and DOCX import work with the distance from the first
page format when they take the last item from the MSWordSections
container at the end of the export.
RTF writes section info before the document content, and in case there
are separate first and follow page formats, then we work with the follow
format since commit 20a53cb9e9c7b797c091fe6ac6a34dfb28c61304
(INTEGRATION: CWS limerickfilterteam08 (1.16.32); FILE MERGED,
2003-09-01) as a fix for i#13107.
There is no perfect solution here, the sw doc model can store different
header distances for first and follow pages, while Word works with a
single distance. But RTF/DOCX/DOC import puts the relevant header
distance to the first page format and DOCX/DOC export reads the distance
from there, so be consistent and do the same in the RTF export as well.
This means the DOCX import -> RTF export -> RTF import sequence from the
bugreport will result in a correct header distance.
Change-Id: I3f1fe3080360702c41d680b8785cc3602e74685e
Reviewed-on: https://gerrit.libreoffice.org/54680
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/ww8/rtfexport.cxx')
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 0b206edcf693..7c5e096ea5b3 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -1348,7 +1348,10 @@ void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirst const SwFormat* pFormat = &m_pCurrentPageDesc->GetMaster(); //GetLeft(); m_bOutPageDescs = true; + if (m_pCurrentPageDesc != &rPgDsc) + m_pFirstPageItemSet = &rPgDsc.GetMaster().GetAttrSet(); OutputFormat(*pFormat, true, false); + m_pFirstPageItemSet = nullptr; m_bOutPageDescs = false; // normal header / footer (without a style) |