void BTextView::LineBuffer::RemoveLineRange(int32 fromOffset, int32 toOffset) { int32 fromLine = OffsetToLine(fromOffset); int32 toLine = OffsetToLine(toOffset); int32 count = toLine - fromLine; if (count > 0) RemoveLines(fromLine + 1, count); BumpOffset(fromOffset - toOffset, fromLine + 1); }
uint32 TTextLayout::OffsetToPoint(STextOffset offset, TPoint& point) const { uint32 line = OffsetToLine(offset); ASSERT(line < fLineCount); LineRec& rec = fLineBreaks[line]; point.v = rec.vertOffset + rec.ascent + fInset.v; if (offset == rec.textOffset) point.h = fInset.h; else point.h = MeasureText(fText + rec.textOffset, offset - rec.textOffset, 0) + fInset.h; return line; }