]> git.saurik.com Git - wxWidgets.git/commitdiff
wxRTC: save and load the 'shown' status in case there's a situation where layout...
authorJulian Smart <julian@anthemion.co.uk>
Sun, 29 Sep 2013 12:06:17 +0000 (12:06 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 29 Sep 2013 12:06:17 +0000 (12:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextxml.cpp

index 443a9c21453c1a838a27dbbeef4afe65919b1f5a..cf413f42ffefa284008c432d0fef3e05202abbcf 100644 (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)