diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2017-02-22 10:40:14 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2017-02-22 14:18:31 +0000 |
commit | e1190058b5d4d3cec9959dfa1e9fa87818f710e8 (patch) | |
tree | aaeb56589bc3a303882098b1aa04ee351fa48c59 /starmath/qa | |
parent | 46b5dff4db336df2ff6496d91b0a2c559c6a9592 (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')
-rw-r--r-- | starmath/qa/cppunit/test_starmath.cxx | 11 |
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); |