summaryrefslogtreecommitdiff
path: root/starmath/qa/cppunit
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2017-02-22 10:40:14 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2017-02-22 14:18:31 +0000
commite1190058b5d4d3cec9959dfa1e9fa87818f710e8 (patch)
treeaaeb56589bc3a303882098b1aa04ee351fa48c59 /starmath/qa/cppunit
parent46b5dff4db336df2ff6496d91b0a2c559c6a9592 (diff)
Test whether SmEditWindow::SelNextMark() keeps cursor position
when there is no next placeholder marker. Change-Id: I9846b304074c39f49118710a758d44a43f926b25 Reviewed-on: https://gerrit.libreoffice.org/34531 Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp> Tested-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath/qa/cppunit')
-rw-r--r--starmath/qa/cppunit/test_starmath.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx
index a6916bf521bf..852cf6abf1bb 100644
--- a/starmath/qa/cppunit/test_starmath.cxx
+++ b/starmath/qa/cppunit/test_starmath.cxx
@@ -119,6 +119,7 @@ void Test::editMarker()
{
OUString sTargetText("a under b under c");
+ ESelection aSelection;
m_pEditWindow->SelNextMark();
m_pEditWindow->Delete();
@@ -129,13 +130,21 @@ void Test::editMarker()
m_pEditWindow->Delete();
m_pEditWindow->InsertText("c");
+ // should be safe i.e. do nothing
+ m_pEditWindow->SelNextMark();
+ aSelection = m_pEditWindow->GetSelection();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.nStartPara);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(19), aSelection.nStartPos);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.nEndPara);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(19), aSelection.nEndPos);
+
m_pEditWindow->SelPrevMark();
m_pEditWindow->Delete();
m_pEditWindow->InsertText("b");
// tdf#106116: should be safe i.e. do nothing
m_pEditWindow->SelPrevMark();
- auto aSelection = m_pEditWindow->GetSelection();
+ aSelection = m_pEditWindow->GetSelection();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.nStartPara);
CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aSelection.nStartPos);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aSelection.nEndPara);