summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-03-03 12:00:57 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-03-03 15:54:04 +0100
commit93a8247598bae20a2d9b3eb9abc2578fd2e4a712 (patch)
treeb68cd53c5bb5666cb38ffa6eaf07bb5ce4fa2fd3
parent998dda1d674151a3b5f81483941fc8719f8298fe (diff)
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@libreoffice.org>
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx14
1 files changed, 14 insertions, 0 deletions
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();