From: Julian Smart Date: Wed, 3 Feb 2010 11:43:08 +0000 (+0000) Subject: Don't select all if there is nothing to select. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b30661fdd01159eceffd1a35dcc51b8a4d803854 Don't select all if there is nothing to select. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63374 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 300a87d678..be2bc269ee 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -2812,12 +2812,13 @@ void wxRichTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event) void wxRichTextCtrl::OnSelectAll(wxCommandEvent& WXUNUSED(event)) { - SelectAll(); + if (GetLastPosition() > 0) + SelectAll(); } void wxRichTextCtrl::OnUpdateSelectAll(wxUpdateUIEvent& event) { - event.Enable(GetLastPosition() >= 0); + event.Enable(GetLastPosition() > 0); } void wxRichTextCtrl::OnContextMenu(wxContextMenuEvent& event)