Caret position corrected to end of selection

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@64433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2010-05-30 14:00:23 +00:00
parent f2ef438692
commit a9ad1e1b0a

View File

@@ -2606,8 +2606,7 @@ void wxRichTextCtrl::DoSetSelection(long from, long to, bool WXUNUSED(scrollCare
m_selectionAnchor = from-1;
m_selectionRange.SetRange(from, to-1);
// Have to subtract 2, one because of endPos+1 rule (SetSelection docs) and another to turn into caret position.
m_caretPosition = wxMax(-1, to-2);
m_caretPosition = wxMax(-1, to-1);
wxRichTextCtrlRefreshForSelectionChange(*this, oldSelection, m_selectionRange);
PositionCaret();