From 07a4509a63bfc06fca31972002e2861449df49c3 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 5 Apr 2010 21:10:40 +0000 Subject: Validated utf-8 safety of Fl_Text_Selection. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7443 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Text_Buffer.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx index aa957e867..2b091ec95 100644 --- a/src/Fl_Text_Buffer.cxx +++ b/src/Fl_Text_Buffer.cxx @@ -1778,6 +1778,7 @@ int Fl_Text_Selection::position(int *startpos, int *endpos, } +// unicode safe int Fl_Text_Selection::includes(int pos, int lineStartPos, int dispIndex) const { return (selected() && ( (!rectangular() && pos >= start() && pos < end()) @@ -1999,6 +2000,8 @@ void Fl_Text_Buffer::update_selections(int pos, int nDeleted, mHighlight.update(pos, nDeleted, nInserted); } + +// unicode safe, assuming the arguments are on character boundaries void Fl_Text_Selection::update(int pos, int nDeleted, int nInserted) { if (!mSelected || pos > mEnd) -- cgit v1.2.3