]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed two out by one errors
authorJulian Smart <julian@anthemion.co.uk>
Wed, 20 Feb 2008 20:33:18 +0000 (20:33 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 20 Feb 2008 20:33:18 +0000 (20:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextbuffer.cpp
src/richtext/richtextctrl.cpp

index 182f791719acfda7824203bf9e5589142090b918..039707a80179f360d35a3da5135e71ab05066e7d 100644 (file)
@@ -1766,7 +1766,7 @@ bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const
                         splitPoint ++;
 
                     // Find last object
-                    if (splitPoint == newPara->GetRange().GetEnd() || splitPoint == (newPara->GetRange().GetEnd() - 1))
+                    if (splitPoint == newPara->GetRange().GetEnd())
                         lastObject = newPara->GetChildren().GetLast()->GetData();
                     else
                         // lastObject is set as a side-effect of splitting. It's
index 885a055858305c1874f009f38692cb35bb8d49ba..1fe67c49ce2c4f4abbd83b32d71ae8666c5c690c 100644 (file)
@@ -2339,7 +2339,7 @@ void wxRichTextCtrl::Remove(long from, long to)
 {
     SelectNone();
 
-    GetBuffer().DeleteRangeWithUndo(wxRichTextRange(from, to), this);
+    GetBuffer().DeleteRangeWithUndo(wxRichTextRange(from, to-1), this);
 
     LayoutContent();
     if (!IsFrozen())