]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextxml.cpp
Compile fixes for wxUSE_COLLPANE=0
[wxWidgets.git] / src / richtext / richtextxml.cpp
index 9a34fd8894b6f308bfcb85f443f9efd5a765a2cd..f78883c8be6709b807e5ec747ab0f964d447c215 100644 (file)
@@ -1162,6 +1162,9 @@ wxString wxRichTextXMLHandler::AddAttributes(const wxRichTextAttr& attr, bool is
         if (!attr.GetListStyleName().empty())
             AddAttribute(str, wxT("liststyle"), AttributeToXML(attr.GetListStyleName()));
 
+        if (!attr.GetTextBoxAttr().GetBoxStyleName().empty())
+            AddAttribute(str, wxT("boxstyle"), AttributeToXML(attr.GetTextBoxAttr().GetBoxStyleName()));
+
         if (attr.HasTabs())
         {
             wxString strTabs;
@@ -1190,6 +1193,10 @@ wxString wxRichTextXMLHandler::AddAttributes(const wxRichTextAttr& attr, bool is
     AddAttribute(str, wxT("outline"), attr.GetTextBoxAttr().GetOutline());
     AddAttribute(str, wxT("width"), attr.GetTextBoxAttr().GetWidth());
     AddAttribute(str, wxT("height"), attr.GetTextBoxAttr().GetHeight());
+    AddAttribute(str, wxT("minwidth"), attr.GetTextBoxAttr().GetMinSize().GetWidth());
+    AddAttribute(str, wxT("minheight"), attr.GetTextBoxAttr().GetMinSize().GetHeight());
+    AddAttribute(str, wxT("maxwidth"), attr.GetTextBoxAttr().GetMaxSize().GetWidth());
+    AddAttribute(str, wxT("maxheight"), attr.GetTextBoxAttr().GetMaxSize().GetHeight());
 
     if (attr.GetTextBoxAttr().HasVerticalAlignment())
     {
@@ -1259,7 +1266,7 @@ bool wxRichTextXMLHandler::WriteProperties(wxOutputStream& stream, const wxRichT
         level ++;
 
         OutputIndentation(stream, level);
-        OutputString(stream, wxT("<properties"));
+        OutputString(stream, wxT("<properties>"));
 
         level ++;
 
@@ -1276,14 +1283,14 @@ bool wxRichTextXMLHandler::WriteProperties(wxOutputStream& stream, const wxRichT
                 OutputString(stream, wxT("<property name=\"") + name +
                     wxT("\" type=\"") + var.GetType() + wxT("\" value=\""));
                 OutputStringEnt(stream, value);
-                OutputString(stream, wxT("\"/>\n"));
+                OutputString(stream, wxT("\"/>"));
             }
         }
 
         level --;
 
         OutputIndentation(stream, level);
-        OutputString(stream, wxT("</properties>\n"));
+        OutputString(stream, wxT("</properties>"));
 
         level --;
     }
@@ -1451,6 +1458,9 @@ bool wxRichTextXMLHandler::AddAttributes(wxXmlNode* node, wxRichTextAttr& attr,
         if (!attr.GetListStyleName().empty())
             node->AddAttribute(wxT("liststyle"), attr.GetListStyleName());
 
+        if (!attr.GetTextBoxAttr().GetBoxStyleName().empty())
+            node->AddAttribute(wxT("boxstyle"), attr.GetTextBoxAttr().GetBoxStyleName());
+
         if (attr.HasTabs())
         {
             wxString tabs;
@@ -1478,6 +1488,10 @@ bool wxRichTextXMLHandler::AddAttributes(wxXmlNode* node, wxRichTextAttr& attr,
     AddAttribute(node, wxT("outline"), attr.GetTextBoxAttr().GetOutline());
     AddAttribute(node, wxT("width"), attr.GetTextBoxAttr().GetWidth());
     AddAttribute(node, wxT("height"), attr.GetTextBoxAttr().GetHeight());
+    AddAttribute(node, wxT("minwidth"), attr.GetTextBoxAttr().GetMinSize().GetWidth());
+    AddAttribute(node, wxT("minheight"), attr.GetTextBoxAttr().GetMinSize().GetHeight());
+    AddAttribute(node, wxT("maxwidth"), attr.GetTextBoxAttr().GetMaxSize().GetWidth());
+    AddAttribute(node, wxT("maxheight"), attr.GetTextBoxAttr().GetMaxSize().GetHeight());
 
     if (attr.GetTextBoxAttr().HasVerticalAlignment())
     {
@@ -1804,6 +1818,13 @@ bool wxRichTextXMLHandler::ImportStyle(wxRichTextAttr& attr, wxXmlNode* node, bo
                     attr.SetListStyleName(value);
                 }
             }
+            else if (name == wxT("boxstyle"))
+            {
+                if (!value.empty())
+                {
+                    attr.GetTextBoxAttr().SetBoxStyleName(value);
+                }
+            }
             else if (name == wxT("tabs"))
             {
                 if (!value.empty())
@@ -1850,6 +1871,22 @@ bool wxRichTextXMLHandler::ImportStyle(wxRichTextAttr& attr, wxXmlNode* node, bo
             {
                 attr.GetTextBoxAttr().GetHeight().SetValue(wxRichTextParseDimension(value));
             }
+            else if (name == wxT("minwidth"))
+            {
+                attr.GetTextBoxAttr().GetMinSize().GetWidth().SetValue(wxRichTextParseDimension(value));
+            }
+            else if (name == wxT("minheight"))
+            {
+                attr.GetTextBoxAttr().GetMinSize().GetHeight().SetValue(wxRichTextParseDimension(value));
+            }
+            else if (name == wxT("maxwidth"))
+            {
+                attr.GetTextBoxAttr().GetMaxSize().GetWidth().SetValue(wxRichTextParseDimension(value));
+            }
+            else if (name == wxT("maxheight"))
+            {
+                attr.GetTextBoxAttr().GetMaxSize().GetHeight().SetValue(wxRichTextParseDimension(value));
+            }
 
             else if (name == wxT("verticalalignment"))
             {