[Libreoffice-commits] core.git: sw/qa

Varun varun.dhall at studentpartner.com
Mon Jun 22 04:08:00 PDT 2015


 sw/qa/extras/uiwriter/uiwriter.cxx |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

New commits:
commit 9d9fbbdc1ec57715305563817ce0a7a638da7bda
Author: Varun <varun.dhall at studentpartner.com>
Date:   Sun Jun 21 03:29:14 2015 +0530

    Add test for tdf#75137 crsr movement b/w footnote
    
    Change-Id: Ifd0ec1e7922c54fb3509824de13bb8f0b1c79279
    Reviewed-on: https://gerrit.libreoffice.org/16391
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 22cd38a..815189d 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -95,6 +95,7 @@ public:
     void testdelofTableRedlines();
     void testExportToPicture();
     void testSearchWithTransliterate();
+    void testTdf75137();
     void testTableBackgroundColor();
     void testTdf90362();
     void testUndoCharAttribute();
@@ -137,6 +138,7 @@ public:
     CPPUNIT_TEST(testdelofTableRedlines);
     CPPUNIT_TEST(testExportToPicture);
     CPPUNIT_TEST(testSearchWithTransliterate);
+    CPPUNIT_TEST(testTdf75137);
     CPPUNIT_TEST(testTableBackgroundColor);
     CPPUNIT_TEST(testTdf90362);
     CPPUNIT_TEST(testUndoCharAttribute);
@@ -957,6 +959,23 @@ void SwUiWriterTest::testSearchWithTransliterate()
     CPPUNIT_ASSERT_EQUAL(1,(int)case2);
 }
 
+void SwUiWriterTest::testTdf75137()
+{
+    SwDoc* pDoc = createDoc();
+    SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+    SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(true);
+    pWrtShell->InsertFootnote(OUString("This is first footnote"));
+    sal_uLong firstIndex = pShellCrsr->GetNode().GetIndex();
+    pShellCrsr->GotoFootnoteAnchor();
+    pWrtShell->InsertFootnote(OUString("This is second footnote"));
+    pWrtShell->Up(false, 1, false);
+    sal_uLong secondIndex = pShellCrsr->GetNode().GetIndex();
+    pWrtShell->Down(false, 1, false);
+    sal_uLong thirdIndex = pShellCrsr->GetNode().GetIndex();
+    CPPUNIT_ASSERT_EQUAL(firstIndex, thirdIndex);
+    CPPUNIT_ASSERT(firstIndex != secondIndex);
+}
+
 void SwUiWriterTest::testTableBackgroundColor()
 {
     SwDoc* pDoc = createDoc();


More information about the Libreoffice-commits mailing list