From a10fe43af77b877cc2d4a9ce5a1787755f9ce870 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 13 Aug 2020 11:07:37 +0200 Subject: sw: DOCX export: for soft-page-breaks, export continuous section breaks When a section break is produced based on layout information such as soft-page-break and follow page style, it's a bad idea to generate a page break because the break may be in a different position in Word, particularly if it was inside a fieldmark instruction. It wouldn't work that well to ignore such page breaks in MSWordExportBase::NeedTextNodeSplit() because then they would be created when reaching the next node anyway, via FindPageDesc() fall-back to layout. Unfortunately this breaks the test tdf113849_evenAndOddHeaders.odt which has a page style with follow-page-style on the first page; on re-import from DOCX, the continuous section is now no longer converted to a page break, so pages 2-3 have the wrong header/footers... this seems impossible to fix in general in the import because it doesn't know whether the continuous section break coincides with a layout page break. Arguably this worked before mostly by accident? tdf#113849 isn't about this afaics... Change the test file to have an explicit page break there, which round-trips as intended. The real fix would be adding continuous page style change to Writer i guess... Change-Id: I00ffe3971607c148a7d5c13b89afb936718611c0 --- sw/source/filter/ww8/rtfexport.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/source/filter/ww8/rtfexport.hxx') diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index 055aa50ff04e..527574ad701e 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -125,8 +125,8 @@ protected: /// Get ready for a new section. void PrepareNewPageDesc(const SfxItemSet* pSet, const SwNode& rNd, - const SwFormatPageDesc* pNewPgDescFormat, - const SwPageDesc* pNewPgDesc) override; + const SwFormatPageDesc* pNewPgDescFormat, const SwPageDesc* pNewPgDesc, + bool bViaLayout) override; /// Return value indicates if an inherited outline numbering is suppressed. bool DisallowInheritingOutlineNumbering(const SwFormat& rFormat) override; -- cgit