MarkupParser: Make sure added paragraphs are valid

They need to contain at least one TextSpan, even if empty.
This commit is contained in:
Stephan Aßmus
2014-01-26 15:20:01 +01:00
parent bd68f78d47
commit 3627434d2b
@@ -290,6 +290,11 @@ MarkupParser::_FinishParagraph(bool isLast)
if (!isLast)
fCurrentParagraph.Append(TextSpan("\n", *fCurrentCharacterStyle));
if (fCurrentParagraph.IsEmpty()) {
// Append empty span
fCurrentParagraph.Append(TextSpan("", fNormalStyle));
}
fTextDocument->Append(fCurrentParagraph);
fCurrentParagraph.Clear();
fCurrentParagraph.SetStyle(fParagraphStyle);