From 4b3483e73b08e9b70307e7668a9758558b37c37c Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 20 Feb 2008 20:33:18 +0000 Subject: [PATCH] Fixed two out by one errors git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 2 +- src/richtext/richtextctrl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 182f791719..039707a801 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -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 diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 885a055858..1fe67c49ce 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -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())