Fix for text parsing when the text object has properties

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2014-07-13 08:47:41 +00:00
parent 6eec9dda58
commit aee4a52e64

View File

@@ -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 ||