Paragraph::Remove() Keep last remaining span as empty span.

This commit is contained in:
Stephan Aßmus 2014-01-27 10:41:33 +01:00
parent 819824e020
commit f429142df9
1 changed files with 3 additions and 2 deletions

View File

@ -203,9 +203,10 @@ Paragraph::Remove(int32 offset, int32 length)
}
}
// See if anything from the TextSpan at offset remained
// See if anything from the TextSpan at offset remained, keep it as empty
// span if it is the last remaining span.
index--;
if (span.CountChars() > 0) {
if (span.CountChars() > 0 || fTextSpans.CountItems() == 1) {
fTextSpans.Replace(index, span);
} else {
fTextSpans.Remove(index);