diff --git a/src/richtext/richtextxml.cpp b/src/richtext/richtextxml.cpp index 2f8925fc57..6660faf5aa 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -423,6 +423,38 @@ bool wxRichTextPlainText::ImportFromXML(wxRichTextBuffer* buffer, wxXmlNode* nod { wxString text; wxXmlNode* textChild = node->GetChildren(); + + // First skip past properties, if any. + wxXmlNode* n = textChild; + while (n) + { + // Skip past properties + if ((n->GetType() == wxXML_ELEMENT_NODE) && n->GetName() == wxT("properties")) + { + textChild = n->GetNext(); + n = NULL; + + // Skip past the whitespace after the properties + while (textChild && (textChild->GetType() == wxXML_TEXT_NODE)) + { + wxString text = textChild->GetContent(); + text.Trim(true); + text.Trim(false); + if (!text.IsEmpty()) + { + textChild->SetContent(text); + break; + } + else + textChild = textChild->GetNext(); + } + + break; + } + if (n) + n = n->GetNext(); + } + while (textChild) { if (textChild->GetType() == wxXML_TEXT_NODE ||