diff options
author | Justin Luth <justin_luth@sil.org> | 2016-10-06 16:53:23 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-10-10 06:27:40 +0000 |
commit | 7060c7b642fdc0a369505e430652ee44205e7eed (patch) | |
tree | c0e7ce2ac49a82d6910b0127f5d90914e1ffbf64 /sw/qa | |
parent | 8bfbd7fbd74b69959929e29df3c99aa22ec13ca5 (diff) |
tdf#95367 DOCX: allow r-t of changed first/follow sections
Change-Id: Ibb97411a7dfeebc3edbdd149842bfe626942cf7f
Reviewed-on: https://gerrit.libreoffice.org/29559
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/inheritFirstHeader.docx (renamed from sw/qa/extras/ooxmlimport/data/inheritFirstHeader.docx) | bin | 15002 -> 15002 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf95367_inheritFollowStyle.docx (renamed from sw/qa/extras/ooxmlimport/data/tdf95367_inheritFollowStyle.docx) | bin | 13861 -> 13861 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 28 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 28 |
4 files changed, 28 insertions, 28 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/inheritFirstHeader.docx b/sw/qa/extras/ooxmlexport/data/inheritFirstHeader.docx Binary files differindex e3d7d20a2d23..e3d7d20a2d23 100644 --- a/sw/qa/extras/ooxmlimport/data/inheritFirstHeader.docx +++ b/sw/qa/extras/ooxmlexport/data/inheritFirstHeader.docx diff --git a/sw/qa/extras/ooxmlimport/data/tdf95367_inheritFollowStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf95367_inheritFollowStyle.docx Binary files differindex 96d91ddcafcd..96d91ddcafcd 100644 --- a/sw/qa/extras/ooxmlimport/data/tdf95367_inheritFollowStyle.docx +++ b/sw/qa/extras/ooxmlexport/data/tdf95367_inheritFollowStyle.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 559c4a7a976e..1a6c967e45b3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -1031,6 +1031,34 @@ DECLARE_OOXMLEXPORT_TEST(testTdf90697_continuousBreaksComplex2,"tdf92724_continu } } +DECLARE_OOXMLEXPORT_TEST(testTdf95367_inheritFollowStyle, "tdf95367_inheritFollowStyle.docx") +{ + CPPUNIT_ASSERT_EQUAL(OUString("header"), parseDump("/root/page[2]/header/txt/text()")); +} + +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() ); +} + DECLARE_OOXMLEXPORT_TEST(testTdf81345_045Original,"tdf81345.docx") { //Header wasn't replaced and columns were missing because no new style was created. diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index f42f1e61f507..912e01b55e70 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -443,11 +443,6 @@ are on page 2 and page 3 CPPUNIT_ASSERT_EQUAL( OUString("two"), parseDump("/root/page[3]/body/txt/text()") ); } -DECLARE_OOXMLIMPORT_TEST(testTdf95367_inheritFollowStyle, "tdf95367_inheritFollowStyle.docx") -{ - CPPUNIT_ASSERT_EQUAL(OUString("header"), parseDump("/root/page[2]/header/txt/text()")); -} - DECLARE_OOXMLIMPORT_TEST(testN652364, "n652364.docx") { /* @@ -993,29 +988,6 @@ DECLARE_OOXMLIMPORT_TEST(testN780843b, "n780843b.docx") CPPUNIT_ASSERT_EQUAL( OUString("hidden footer"), xFooterText->getString() ); } -DECLARE_OOXMLIMPORT_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() ); -} - DECLARE_OOXMLIMPORT_TEST(testShadow, "imgshadow.docx") { /* |