{
wxRichTextObject* obj1 = node1->GetData();
- // If the object is empty, optimise it out
- if (obj1->IsEmpty())
- {
- delete obj1;
- }
- else
- {
- firstPara->AppendChild(obj1);
- }
+ firstPara->AppendChild(obj1);
wxRichTextObjectList::compatibility_iterator next1 = node1->GetNext();
nextParagraph->GetChildren().Erase(node1);
RemoveChild(nextParagraph, true);
}
+ // Avoid empty paragraphs
+ if (firstPara && firstPara->GetChildren().GetCount() == 0)
+ {
+ wxRichTextPlainText* text = new wxRichTextPlainText(wxEmptyString);
+ firstPara->AppendChild(text);
+ }
+
if (applyFinalParagraphStyle)
firstPara->SetAttributes(nextParaAttr);