Fixed selection clearing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@52826 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2008-03-26 08:47:58 +00:00
parent a954b0dd20
commit c8de719de2

View File

@@ -1940,7 +1940,10 @@ void wxRichTextCtrl::SelectAll()
void wxRichTextCtrl::SelectNone()
{
if (!(GetSelectionRange() == wxRichTextRange(-2, -2)))
SetSelection(-2, -2);
{
Refresh(false);
m_selectionRange = wxRichTextRange(-2, -2);
}
m_selectionAnchor = -2;
}
@@ -2317,6 +2320,12 @@ void wxRichTextCtrl::SetSelection(long from, long to)
}
void wxRichTextCtrl::DoSetSelection(long from, long to, bool WXUNUSED(scrollCaret))
{
if (from == to)
{
SelectNone();
}
else
{
m_selectionAnchor = from;
m_selectionRange.SetRange(from, to-1);
@@ -2326,6 +2335,7 @@ void wxRichTextCtrl::DoSetSelection(long from, long to, bool WXUNUSED(scrollCare
Refresh(false);
PositionCaret();
}
}
// ----------------------------------------------------------------------------
// Editing