From b802ab694a8a7357d4657f3e11b571144fa7c7bf Mon Sep 17 00:00:00 2001 From: "Attila Bakos (NISZ)" Date: Fri, 12 Mar 2021 14:33:08 +0100 Subject: tdf#141158 DOCX: import discarded headers/footers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before the inactive DOCX headers/footers lost during import time. Now it can be restored by disabling the options “Same content on left and right pages” and “Same content on first page” on the Header and the Footer panes of the Page style. This is for improving the interoperability with other Office programs, e.g. supporting DOCX text document templates better. Follow-up of commit f5dc6b11d2218d94c9effe7a1ab418d0133da5e3 (tdf#140117 sw UI: keep headers/footers when inactive). To start the py-UItest run: $ make UITest_writer_tests7 UITEST_TEST_NAME="tdf141158.TestTdf141158.test_tdf141158" Note: In spite of this patch implements the left/first/first_left page header/footer stash at import time, the left one works correctly at now. This is because the first pages have different page styles so changing the right page style will restore the hidden header/footer content. For this problem further improvements are planned, exactly in the filter part. Number of unit tests had to be modified, because before these headers and footers were dropped. Co-developed-with: Daniel Arato (NISZ) Change-Id: I3dd452a648bc465710698707c083734dc762ed94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112580 Tested-by: László Németh Reviewed-by: László Németh --- sw/qa/extras/uiwriter/uiwriter.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sw/qa/extras/uiwriter/uiwriter.cxx') diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index e47594a27b42..f56cf50d328d 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -5055,7 +5055,9 @@ void SwUiWriterTest::testTdf92648() SwDoc* pDoc = createDoc("tdf92648.docx"); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); // Make sure we have ten draw shapes. - CPPUNIT_ASSERT_EQUAL(sal_Int32(10), SwTextBoxHelper::getCount(pPage)); + // Yes, we have if the left/right pages have different header/footer, + // but if not we have only nine of them: + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), SwTextBoxHelper::getCount(pPage)); // and the text boxes haven't got zero height sal_Int32 nCount = 0; for (const SwFrameFormat* pFormat : *pDoc->GetSpzFrameFormats()) -- cgit