diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2024-07-31 11:30:12 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-08-01 13:49:14 +0200 |
commit | 39fd178b86608ebb0717bf15992bdf6b16d6e92a (patch) | |
tree | de0671b26f0597f9973240342550c0ed273f1f4c /sw/qa | |
parent | 514d7384470434a0b0b119e369ff615e2a1499c9 (diff) |
tdf#160843: fix page count reset
- SwTextFormatColl and SwTextNode: explicitly forward page count hint
- add test
Change-Id: Ic37bece92828f21632acff8f802d4847e820542f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171329
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/core/doc/data/tdf160843.odt | bin | 0 -> 9971 bytes | |||
-rw-r--r-- | sw/qa/core/doc/doc.cxx | 23 |
2 files changed, 23 insertions, 0 deletions
diff --git a/sw/qa/core/doc/data/tdf160843.odt b/sw/qa/core/doc/data/tdf160843.odt Binary files differnew file mode 100644 index 000000000000..97f0619a433b --- /dev/null +++ b/sw/qa/core/doc/data/tdf160843.odt diff --git a/sw/qa/core/doc/doc.cxx b/sw/qa/core/doc/doc.cxx index b207f9c0f9bb..0da481188cbe 100644 --- a/sw/qa/core/doc/doc.cxx +++ b/sw/qa/core/doc/doc.cxx @@ -609,6 +609,29 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testSplitFlyInsertUndo) CPPUNIT_ASSERT(!rFlyFormats.empty()); } +CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testVirtPageNumReset) +{ + createSwDoc("tdf160843.odt"); + auto pWrtShell = getSwDocShell()->GetWrtShell(); + sal_uInt16 nPhys = 0; + sal_uInt16 nVirt = 0; + + pWrtShell->GotoPage(1, false); + pWrtShell->GetPageNum(nPhys, nVirt, true, false); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(1), nPhys); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(1), nVirt); + + pWrtShell->GotoPage(3, false); + pWrtShell->GetPageNum(nPhys, nVirt, true, false); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(3), nPhys); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(1), nVirt); + + pWrtShell->GotoPage(5, false); + pWrtShell->GetPageNum(nPhys, nVirt, true, false); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(5), nPhys); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(1), nVirt); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |