wxRTC: save and load the 'shown' status in case there's a situation where layout doesn't restore it

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2013-09-29 12:06:17 +00:00
parent f7f8a13c04
commit ac448bc0a0

View File

@@ -349,6 +349,10 @@ bool wxRichTextObject::ImportFromXML(wxRichTextBuffer* WXUNUSED(buffer), wxXmlNo
handler->GetHelper().ImportProperties(GetProperties(), node);
handler->GetHelper().ImportStyle(GetAttributes(), node, UsesParagraphAttributes());
wxString value = node->GetAttribute(wxT("show"), wxEmptyString);
if (!value.IsEmpty())
Show(value == wxT("1"));
*recurse = true;
return true;
@@ -362,6 +366,8 @@ bool wxRichTextObject::ExportXML(wxOutputStream& stream, int indent, wxRichTextX
handler->GetHelper().OutputString(stream, wxT("<") + GetXMLNodeName());
wxString style = handler->GetHelper().AddAttributes(GetAttributes(), true);
if (!IsShown())
style << wxT(" show=\"0\"");
handler->GetHelper().OutputString(stream, style + wxT(">"));
@@ -395,6 +401,8 @@ bool wxRichTextObject::ExportXML(wxXmlNode* parent, wxRichTextXMLHandler* handle
parent->AddChild(elementNode);
handler->GetHelper().AddAttributes(elementNode, GetAttributes(), true);
handler->GetHelper().WriteProperties(elementNode, GetProperties());
if (!IsShown())
elementNode->AddAttribute(wxT("show"), wxT("0"));
wxRichTextCompositeObject* composite = wxDynamicCast(this, wxRichTextCompositeObject);
if (composite)