sw/qa/extras/uiwriter/data/tdf83798.odt |binary sw/qa/extras/uiwriter/uiwriter.cxx | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+)
New commits: commit a8228c4950eda9310382c8f773ade578367ca501 Author: Varun <varun.dh...@studentpartner.com> Date: Thu Jun 25 23:04:42 2015 +0530 Add test for tdf#83798 ToC missing chapter numbers Change-Id: Iffb2c619b7ac266c5a172d4cc45501a9ba5b74bb Reviewed-on: https://gerrit.libreoffice.org/16489 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Michael Stahl <mst...@redhat.com> diff --git a/sw/qa/extras/uiwriter/data/tdf83798.odt b/sw/qa/extras/uiwriter/data/tdf83798.odt new file mode 100644 index 0000000..51b01cd Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf83798.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 2f5171d..668aa43 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -98,6 +98,7 @@ public: void testExportToPicture(); void testSearchWithTransliterate(); void testTdf75137(); + void testTdf83798(); void testTableBackgroundColor(); void testTdf90362(); void testUndoCharAttribute(); @@ -143,6 +144,7 @@ public: CPPUNIT_TEST(testExportToPicture); CPPUNIT_TEST(testSearchWithTransliterate); CPPUNIT_TEST(testTdf75137); + CPPUNIT_TEST(testTdf83798); CPPUNIT_TEST(testTableBackgroundColor); CPPUNIT_TEST(testTdf90362); CPPUNIT_TEST(testUndoCharAttribute); @@ -1064,6 +1066,43 @@ void SwUiWriterTest::testTdf75137() CPPUNIT_ASSERT(firstIndex != secondIndex); } +void SwUiWriterTest::testTdf83798() +{ + SwDoc* pDoc = createDoc("tdf83798.odt"); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + pWrtShell->GotoNextTOXBase(); + const SwTOXBase* pTOXBase = pWrtShell->GetCurTOX(); + pWrtShell->UpdateTableOf(*pTOXBase, nullptr); + SwPaM* pCrsr = pDoc->GetEditShell()->GetCrsr(); + pCrsr->SetMark(); + pCrsr->Move(fnMoveForward, fnGoNode); + CPPUNIT_ASSERT_EQUAL(OUString("Table of Contents"), pCrsr->GetText()); + pCrsr->DeleteMark(); + pCrsr->SetMark(); + pCrsr->Move(fnMoveForward, fnGoContent); + CPPUNIT_ASSERT_EQUAL(OUString("1"), pCrsr->GetText()); + pCrsr->DeleteMark(); + pCrsr->Move(fnMoveForward, fnGoNode); + pCrsr->SetMark(); + pCrsr->Move(fnMoveForward, fnGoContent); + pCrsr->Move(fnMoveForward, fnGoContent); + pCrsr->Move(fnMoveForward, fnGoContent); + CPPUNIT_ASSERT_EQUAL(OUString("1.A"), pCrsr->GetText()); + pCrsr->DeleteMark(); + pCrsr->Move(fnMoveForward, fnGoNode); + pCrsr->SetMark(); + pCrsr->Move(fnMoveForward, fnGoContent); + CPPUNIT_ASSERT_EQUAL(OUString("2"), pCrsr->GetText()); + pCrsr->DeleteMark(); + pCrsr->Move(fnMoveForward, fnGoNode); + pCrsr->SetMark(); + pCrsr->Move(fnMoveForward, fnGoContent); + pCrsr->Move(fnMoveForward, fnGoContent); + pCrsr->Move(fnMoveForward, fnGoContent); + CPPUNIT_ASSERT_EQUAL(OUString("2.A"), pCrsr->GetText()); + pCrsr->DeleteMark(); +} + void SwUiWriterTest::testTableBackgroundColor() { SwDoc* pDoc = createDoc(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits