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

Takeshi Abe tabe at fixedpoint.jp
Wed Feb 22 14:18:55 UTC 2017


 starmath/qa/cppunit/test_starmath.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit e1190058b5d4d3cec9959dfa1e9fa87818f710e8
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Wed Feb 22 10:40:14 2017 +0900

    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 at fixedpoint.jp>
    Tested-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx
index a6916bf..852cf6a 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);


More information about the Libreoffice-commits mailing list