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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 3 14:54:46 UTC 2021


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

New commits:
commit 93a8247598bae20a2d9b3eb9abc2578fd2e4a712
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Mar 3 12:00:57 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Mar 3 15:54:04 2021 +0100

    sw_uiwriter: Add test for cursor position when moving up
    
    Found in https://gerrit.libreoffice.org/c/core/+/109571
    
    Change-Id: I31217d1e0189973d4cdb4721939687ef4355c6d1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111894
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 7495b9ab74ff..cfb22cd86ca2 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -216,6 +216,7 @@ public:
     void testCreatePortions();
     void testBookmarkUndo();
     void testFdo85876();
+    void testCaretPositionMovingUp();
     void testTdf81226();
     void testTdf79717();
     void testTdf137532();
@@ -449,6 +450,7 @@ public:
     CPPUNIT_TEST(testCreatePortions);
     CPPUNIT_TEST(testBookmarkUndo);
     CPPUNIT_TEST(testFdo85876);
+    CPPUNIT_TEST(testCaretPositionMovingUp);
     CPPUNIT_TEST(testTdf81226);
     CPPUNIT_TEST(testTdf79717);
     CPPUNIT_TEST(testTdf137532);
@@ -2029,6 +2031,18 @@ void SwUiWriterTest::testFdo85876()
     }
 }
 
+void SwUiWriterTest::testCaretPositionMovingUp()
+{
+    SwDoc* const pDoc = createDoc();
+    SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+    pWrtShell->Insert("after");
+    pWrtShell->InsertLineBreak();
+    pWrtShell->Up(false);
+    pWrtShell->Insert("before");
+
+    CPPUNIT_ASSERT_EQUAL(OUString(u"beforeAfter" + OUStringChar(CH_TXTATR_NEWLINE)), getParagraph(1)->getString());
+}
+
 void SwUiWriterTest::testTdf81226()
 {
     SwDoc* const pDoc = createDoc();


More information about the Libreoffice-commits mailing list