]> git.saurik.com Git - wxWidgets.git/commitdiff
wxRichTextCtrl no longer deletes a character when content is selected
authorJulian Smart <julian@anthemion.co.uk>
Fri, 28 Nov 2008 12:35:15 +0000 (12:35 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 28 Nov 2008 12:35:15 +0000 (12:35 +0000)
before pressing Delete (fixes bug #10153).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextctrl.cpp

index e987e6027ae95ae1a9eeefe373c5e06d9a7ed9d3..1b321c28f1988a034551b2cc8a3b16812f6819d6 100644 (file)
@@ -872,13 +872,12 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
 
         long newPos = m_caretPosition;
 
-        DeleteSelectedContent(& newPos);
+        bool processed = DeleteSelectedContent(& newPos);
 
         // Submit range in character positions, which are greater than caret positions,
         // so subtract 1 for deleted character and add 1 for conversion to character position.
         if (newPos > -1)
         {
-            bool processed = false;
             if (event.CmdDown())
             {
                 long pos = wxRichTextCtrl::FindNextWordPosition(-1);
@@ -922,12 +921,11 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
 
         long newPos = m_caretPosition;
 
-        DeleteSelectedContent(& newPos);
+        bool processed = DeleteSelectedContent(& newPos);
 
         // Submit range in character positions, which are greater than caret positions,
         if (newPos < GetBuffer().GetRange().GetEnd()+1)
         {
-            bool processed = false;
             if (event.CmdDown())
             {
                 long pos = wxRichTextCtrl::FindNextWordPosition(1);