From 04b2b47a4e817fb32a78316b8b50efd0612509b9 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 13 Jul 2012 16:38:15 +0000 Subject: [PATCH] Fixed wxRichTextCtrl caret test case git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextctrl.cpp | 3 ++- tests/controls/richtextctrltest.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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()); -- 2.45.2