summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2023-05-31 15:33:24 -0400
committerJustin Luth <jluth@mail.com>2023-06-01 00:29:31 +0200
commita05dc1591ca9122056e95cb2801e7f924bb7ecdb (patch)
treee482fc41c7b90c1142d929e47fc3a57f7ef96017 /sw
parent74a306ef4aa425a5637c7c4766600de6c4bc504c (diff)
tdf#104704 tdf#145998 doc/rtf import: don't lose section page break
This fixes a LO 7.5 regression from commit c37f62b71fa59917ef85ff98480dff18aa936e41 That 7.5 fix focused on DOCX, and didn't realize that the doc/rtf path couldn't handle the same logic. Just reverting to previous behaviour for DOC/RTF for now. (It is too hard to find relevant documents because any document starting with a section break on the first paragraph [and there are MANY of these - an ODT default], and that scenario harmlessly matches this code path.) Change-Id: I82cfe10e217269448d38df0ca03ce6cae3536e56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152467 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8export/data/tdf104704_mangledFooter.odtbin0 -> 14722 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export4.cxx5
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx5
3 files changed, 8 insertions, 2 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf104704_mangledFooter.odt b/sw/qa/extras/ww8export/data/tdf104704_mangledFooter.odt
new file mode 100644
index 000000000000..2bd8c10f9ca4
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf104704_mangledFooter.odt
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx
index 4a290a53f2d9..9b0f1f321b7b 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -142,6 +142,11 @@ CPPUNIT_TEST_FIXTURE(Test, testDontBreakWrappedTables)
CPPUNIT_ASSERT(bDontBreakWrappedTables);
}
+DECLARE_WW8EXPORT_TEST(testTdf104704_mangledFooter, "tdf104704_mangledFooter.odt")
+{
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 041abc5c65c5..30df5b265b46 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -532,8 +532,9 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
// sections during import, so minimize unnecessary duplication
// by substituting a simple page break when the resulting section is identical,
// unless this is needed to re-number the page.
- if (!bNewPageDesc && !pItem->GetNumOffset() && m_pCurrentPageDesc
- && m_pCurrentPageDesc->GetFollow() == pItem->GetPageDesc())
+ // DOCX only.
+ if (!bNewPageDesc && !pItem->GetNumOffset() && !PreferPageBreakBefore()
+ && m_pCurrentPageDesc && m_pCurrentPageDesc->GetFollow() == pItem->GetPageDesc())
{
// A section break on the very first paragraph is ignored by LO/Word
// and should NOT be turned into a page break.