From: Julian Smart <julian@anthemion.co.uk>
Date: Fri, 13 Jul 2012 16:38:15 +0000 (+0000)
Subject: Fixed wxRichTextCtrl caret test case
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/04b2b47a4e817fb32a78316b8b50efd0612509b9?hp=3a2b37010cbba185b8f1d0ec69a9c7ce3e4d7310

Fixed wxRichTextCtrl caret test case


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp
index 3d7a97adb4..721db6b872 100644
--- a/src/richtext/richtextctrl.cpp
+++ b/src/richtext/richtextctrl.cpp
@@ -2208,7 +2208,7 @@ bool wxRichTextCtrl::MoveToParagraphStart(int flags)
         if (!extendSel)
             SelectNone();
 
-        SetCaretPosition(newPos);
+        SetCaretPosition(newPos, true);
         PositionCaret();
         SetDefaultStyleToCursorStyle();
 
@@ -3174,6 +3174,7 @@ void wxRichTextCtrl::SetInsertionPoint(long pos)
     SelectNone();
 
     m_caretPosition = pos - 1;
+    m_caretAtLineStart = true;
 
     PositionCaret();
 
diff --git a/tests/controls/richtextctrltest.cpp b/tests/controls/richtextctrltest.cpp
index 087a07b5c6..f3813de3c5 100644
--- a/tests/controls/richtextctrltest.cpp
+++ b/tests/controls/richtextctrltest.cpp
@@ -350,7 +350,7 @@ void RichTextCtrlTestCase::CaretPosition()
     m_rich->AddParagraph("This is paragraph one");
     m_rich->AddParagraph("Paragraph two\n has \nlots of\n lines");
 
-    m_rich->MoveCaret(1);
+    m_rich->SetInsertionPoint(2);
 
     CPPUNIT_ASSERT_EQUAL(1, m_rich->GetCaretPosition());