diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 23 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 29 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 12 |
4 files changed, 19 insertions, 47 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 9decd693f327..d5da1882eb35 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -474,7 +474,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135216_evenOddFooter, "tdf135216_evenOddFooter.o xCursor->jumpToNextPage(); pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); xPageStyle.set(xPageStyles->getByName(pageStyleName), uno::UNO_QUERY); - xFooter.set(getProperty<uno::Reference<text::XText>>(xPageStyle, "FooterTextRight")); + xFooter.set(getProperty<uno::Reference<text::XText>>(xPageStyle, "FooterTextFirst")); CPPUNIT_ASSERT_EQUAL(OUString("odd page - first footer"), xFooter->getString()); xCursor->jumpToNextPage(); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 5cd8f4a0fe32..5858eec46524 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -1187,24 +1187,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf95367_inheritFollowStyle, "tdf95367_inheritFollo DECLARE_OOXMLEXPORT_TEST(testInheritFirstHeader,"inheritFirstHeader.docx") { // First page headers always link to last used first header, never to a follow header - uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); - uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - - xCursor->jumpToLastPage(); - OUString sPageStyleName = getProperty<OUString>( xCursor, "PageStyleName" ); - uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName(sPageStyleName), "HeaderText"); - CPPUNIT_ASSERT_EQUAL( OUString("Last Header"), xHeaderText->getString() ); - - xCursor->jumpToPreviousPage(); - sPageStyleName = getProperty<OUString>( xCursor, "PageStyleName" ); - xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName(sPageStyleName), "HeaderText"); - CPPUNIT_ASSERT_EQUAL( OUString("First Header"), xHeaderText->getString() ); - - xCursor->jumpToPreviousPage(); - sPageStyleName = getProperty<OUString>( xCursor, "PageStyleName" ); - xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName(sPageStyleName), "HeaderText"); - CPPUNIT_ASSERT_EQUAL( OUString("Follow Header"), xHeaderText->getString() ); + CPPUNIT_ASSERT_EQUAL(OUString("First Header"), parseDump("/root/page[1]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Follow Header"), parseDump("/root/page[2]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Follow Header"), parseDump("/root/page[3]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("First Header"), parseDump("/root/page[4]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Last Header"), parseDump("/root/page[5]/header/txt/text()")); } #if HAVE_MORE_FONTS diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 1ac07aaff0cc..59d713fdfb04 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -419,14 +419,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf59699, "tdf59699.docx") DECLARE_OOXMLEXPORT_TEST(testN777337, "n777337.docx") { - /* - * The problem was that the top and bottom margin on the first page was only 0.1cm instead of 1.7cm. - * - * oFirst = ThisComponent.StyleFamilies.PageStyles.getByName("First Page") - * xray oFirst.TopMargin - * xray oFirst.BottomMargin - */ - uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("First Page"), uno::UNO_QUERY); + // The problem was that the top and bottom margin on the first page was only 0.1cm instead of 1.7cm. + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1702), getProperty<sal_Int32>(xPropertySet, "TopMargin")); CPPUNIT_ASSERT_EQUAL(sal_Int32(1702), getProperty<sal_Int32>(xPropertySet, "BottomMargin")); } @@ -586,19 +580,7 @@ DECLARE_OOXMLEXPORT_TEST(testN780853, "n780853.docx") DECLARE_OOXMLEXPORT_TEST(testN780843, "n780843.docx") { - uno::Reference< text::XTextRange > xPara = getParagraph(1); - OUString aStyleName = getProperty<OUString>(xPara, "PageStyleName"); - // what happens on export here is that the "Default Style" isn't actually - // used on page 2, because of the hard page break with style "Converted2" - // and therefore SwPageDesc::IsFollowNextPageOfNode() returns false and - // "w:titlepg" element is not written - // (the export result is wrong with or without w:titlepg, because the footer - // on the 2nd page should be the text "shown footer") - if (mbExported) - CPPUNIT_ASSERT_EQUAL(OUString("Standard"), aStyleName); - else - CPPUNIT_ASSERT_EQUAL(OUString("First Page"), aStyleName); - + CPPUNIT_ASSERT_EQUAL(OUString("shown footer"), parseDump("/root/page[2]/footer/txt/text()")); //tdf64372 this document should only have one page break (2 pages, not 3) CPPUNIT_ASSERT_EQUAL(2, getPages()); @@ -786,7 +768,10 @@ DECLARE_OOXMLEXPORT_TEST(testN779642, "n779642.docx") // tdf#106572 - perhaps not the best test to hijack since this file // produces an error in Word, but it nicely matches danger points, // and has a different first footer, so nice visual confirmation. - CPPUNIT_ASSERT_EQUAL(OUString("First Page"), getProperty<OUString>(getParagraphOrTable(1), "PageDescName")); + discardDumpedLayout(); + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // There is no footer text on the first page. + assertXPath(pXmlDoc, "/root/page[1]/footer/txt", 0); } DECLARE_OOXMLEXPORT_TEST(testTbLrHeight, "tblr-height.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 57de8c58a3ed..4416edc4ef69 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -586,9 +586,9 @@ DECLARE_SW_EXPORT_TEST(testHFLinkToPrev, "headerfooter-link-to-prev.docx", nullp xPageStyles->getByName(pageStyleName), uno::UNO_QUERY); // check page 1 header & footer text CPPUNIT_ASSERT_EQUAL(OUString("First page header for all sections"), - getHFText(xPageStyle, "HeaderText")); + getHFText(xPageStyle, "HeaderTextFirst")); CPPUNIT_ASSERT_EQUAL(OUString("First page footer for section 1 only"), - getHFText(xPageStyle, "FooterText")); + getHFText(xPageStyle, "FooterTextFirst")); // get LO page style for page 2, corresponding to docx section 1 xCursor->jumpToPage(2); @@ -610,9 +610,9 @@ DECLARE_SW_EXPORT_TEST(testHFLinkToPrev, "headerfooter-link-to-prev.docx", nullp xPageStyle.set( xPageStyles->getByName(pageStyleName), uno::UNO_QUERY ); // check header & footer text CPPUNIT_ASSERT_EQUAL(OUString("First page header for all sections"), - getHFText(xPageStyle, "HeaderText")); + getHFText(xPageStyle, "HeaderTextFirst")); CPPUNIT_ASSERT_EQUAL(OUString("First page footer for sections 2 and 3 only"), - getHFText(xPageStyle, "FooterText")); + getHFText(xPageStyle, "FooterTextFirst")); // get LO page style for page 5, corresponding to docx section 2 xCursor->jumpToPage(5); @@ -634,9 +634,9 @@ DECLARE_SW_EXPORT_TEST(testHFLinkToPrev, "headerfooter-link-to-prev.docx", nullp xPageStyle.set( xPageStyles->getByName(pageStyleName), uno::UNO_QUERY ); // check header & footer text CPPUNIT_ASSERT_EQUAL(OUString("First page header for all sections"), - getHFText(xPageStyle, "HeaderText")); + getHFText(xPageStyle, "HeaderTextFirst")); CPPUNIT_ASSERT_EQUAL(OUString("First page footer for sections 2 and 3 only"), - getHFText(xPageStyle, "FooterText")); + getHFText(xPageStyle, "FooterTextFirst")); // get LO page style for page 8, corresponding to docx section 3 xCursor->jumpToPage(8); |