diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-05-17 12:52:14 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-05-17 16:54:51 +0200 |
commit | 247738a9afeeb2f0644fa0307b7023fe115fae83 (patch) | |
tree | b84b7f5f7b04e552307d665302580c47e2b97401 | |
parent | 1fe4d37caa983dea9815082e3e955337a03034e9 (diff) |
tdf#155324 sw: add unit test
Change-Id: I0df173be99b8b9fa3920431a8386e14fd1d2260e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151876
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r-- | sw/qa/extras/layout/data/tox-update-wrong-pages.odt | bin | 0 -> 18234 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout3.cxx | 34 |
2 files changed, 34 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tox-update-wrong-pages.odt b/sw/qa/extras/layout/data/tox-update-wrong-pages.odt Binary files differnew file mode 100644 index 000000000000..40ceb7ac4bd2 --- /dev/null +++ b/sw/qa/extras/layout/data/tox-update-wrong-pages.odt diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index 687b1c78ddd7..75d87278a2b4 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -133,6 +133,40 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf106234) "width", "7881"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155324) +{ + createSwDoc("tox-update-wrong-pages.odt"); + + dispatchCommand(mxComponent, ".uno:UpdateAllIndexes", {}); + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + // the problem was that the first entry was on page 7, 2nd on page 9 etc. + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", "Foo"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", "5"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", "bar"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", "7"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", "Three"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", "7"); + + // check first content page has the footnotes + assertXPath(pXmlDoc, "/root/page[5]/body/txt[1]/SwParaPortion/SwLineLayout", "portion", "Foo"); + assertXPath(pXmlDoc, "/root/page[4]/ftncont", 0); + assertXPath(pXmlDoc, "/root/page[5]/ftncont/ftn", 5); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287b) { createSwDoc("tdf120287b.fodt"); |