From: Julian Smart Date: Sun, 28 Sep 2008 18:02:23 +0000 (+0000) Subject: Fix for deleting first word in the control X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8251c171de1bb4bbe281c339315f4d1f9aac5eec Fix for deleting first word in the control git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55936 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 3a6432a531..ef6ed5486d 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -300,7 +300,7 @@ void wxRichTextCtrl::DoThaw() LayoutContent(); else SetupScrollbars(); - + wxWindow::DoThaw(); } @@ -675,7 +675,7 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event) if (event.CmdDown()) { long pos = wxRichTextCtrl::FindNextWordPosition(-1); - if (pos != -1 && (pos < newPos)) + if (pos < newPos) { GetBuffer().DeleteRangeWithUndo(wxRichTextRange(pos+1, newPos), this); processed = true; @@ -802,7 +802,7 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event) if (event.CmdDown()) { long pos = wxRichTextCtrl::FindNextWordPosition(-1); - if (pos != -1 && (pos < newPos)) + if (pos < newPos) { GetBuffer().DeleteRangeWithUndo(wxRichTextRange(pos+1, newPos), this); processed = true;