Skip to content
Snippets Groups Projects
Commit b44ade68 authored by Kitty Barnett's avatar Kitty Barnett
Browse files

FIXED Calling LLTextBase::insertStringNoUndo() with more than one segment...

FIXED Calling LLTextBase::insertStringNoUndo() with more than one segment results in overlapping segment ranges
Text is only inserted into the view model *after* the segments are added so if seg1_pos_start is the current EOF:
  -> 1st segment: getSegIterContaining(seg1_pos_start) returns the last segment and insertSegment() ends up properly adjusting its start/end position
  -> 2nd segment: getSegIterContaining(seg2_pos_start) returns mSegments.end() since its position is beyond the available and insertSegment() leaves the last 2 segments with overlapping ranges
After the fix:
  -> if index runs past the end of all segments then mSegments.end() is returned (no change)
  -> if index is a position past the length of text but claimed by a segment then that segment is returned (change)
  -> if index specifies a position in the middle of the document unclaimed by any segment then the first segment after that position is returned (no change)
     (this does break the assertion that segment->mStart <= index <= segment->mEnd?)
parent 5a6ddb2e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment