sw/qa/extras/ww8export/ww8export3.cxx | 4 ++++ sw/source/filter/ww8/ww8par.cxx | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-)
New commits: commit 1c8df3e58940bf6abdbda0b2f932a5990b577fae Author: Justin Luth <[email protected]> AuthorDate: Fri Feb 19 20:08:43 2021 +0200 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Feb 26 12:24:17 2021 +0100 tdf#118711 doc import: don't hardcode default page description well, at least not at the beginning of the document. This is a .DOC followup to the 7.1 .DOCX patch in commit 8787a45f9cbb5dce61b20817ef0e549b5a227a95. The problem with specifying is that it becomes a property of the paragraph - and so if the paragraph is copied or moved, the page break comes along with it and the user has to remove the unnecessary page break wherever it lands. Since the default will be applied anyway, there is no value in specifying it. In DOC, it appears that the first page is ALWAYS set to the default page. I tried to create a title page/first page page style, but it always round-tripped as default page. That makes it easier, with only specified page number exception. Change-Id: Ie2e5ec42331d66f1883fc7b96fcefceb6d32c73d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111240 Tested-by: Jenkins Reviewed-by: Justin Luth <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index e18df90483d3..b5b033468b02 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -81,6 +81,10 @@ DECLARE_WW8EXPORT_TEST(testTdf138345_paraCharHighlight, "tdf138345_paraCharHighl // Character style formatting must not contain a highlight setting at all. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(COL_AUTO), getProperty<sal_Int32>(xRun, "CharHighlight")); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(COL_AUTO), getProperty<sal_Int32>(xRun, "CharBackColor")); + + //tdf#118711 - don't explicity specify the default page style at the beginning of the document + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(uno::Any(), xPara->getPropertyValue("PageDescName")); } DECLARE_WW8EXPORT_TEST(testTdf104596_wrapInHeaderTable, "tdf104596_wrapInHeaderTable.doc") diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index f872e84f2629..abab8b7d91c4 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4614,7 +4614,10 @@ void wwSectionManager::InsertSegments() aDesc.GetPageDesc()->SetFollow( aFollow.GetPageDesc() ); } - GiveNodePageDesc(aIter->maStart, aDesc, mrReader.m_rDoc); + // Avoid setting the page style at the very beginning since it is always the default style anyway, + // unless it is needed to specify a page number. + if (aIter != aStart || aDesc.GetNumOffset()) + GiveNodePageDesc(aIter->maStart, aDesc, mrReader.m_rDoc); } SwTextNode* pTextNd = nullptr; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
