]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextxml.cpp
Fixed insertion point bug
[wxWidgets.git] / src / richtext / richtextxml.cpp
index 2a9ac747cc31665a5c0fe85ef8f148d10d69d69d..3e03c7055988ff723424cb0f82550bc7e440b577 100644 (file)
@@ -893,22 +893,22 @@ wxString wxRichTextXMLHandler::CreateStyle(const wxTextAttrEx& attr, bool isPara
 
     if (attr.GetFont().Ok())
     {
-        if (attr.HasSize())
+        if (attr.HasFontSize())
             str << wxT(" fontsize=\"") << attr.GetFont().GetPointSize() << wxT("\"");
         
-        //if (attr.HasFamily())
+        //if (attr.HasFontFamily())
         //    str << wxT(" fontfamily=\"") << attr.GetFont().GetFamily() << wxT("\"");
 
-        if (attr.HasItalic())
+        if (attr.HasFontItalic())
             str << wxT(" fontstyle=\"") << attr.GetFont().GetStyle() << wxT("\"");
 
-        if (attr.HasWeight())
+        if (attr.HasFontWeight())
             str << wxT(" fontweight=\"") << attr.GetFont().GetWeight() << wxT("\"");
 
-        if (attr.HasUnderlined())
+        if (attr.HasFontUnderlined())
             str << wxT(" fontunderlined=\"") << (int) attr.GetFont().GetUnderlined() << wxT("\"");
 
-        if (attr.HasFaceName())
+        if (attr.HasFontFaceName())
             str << wxT(" fontface=\"") << attr.GetFont().GetFaceName() << wxT("\"");
     }
 
@@ -917,6 +917,10 @@ wxString wxRichTextXMLHandler::CreateStyle(const wxTextAttrEx& attr, bool isPara
         str << wxT(" texteffects=\"");
         str << attr.GetTextEffects();
         str << wxT("\"");
+
+        str << wxT(" texteffectflags=\"");
+        str << attr.GetTextEffectFlags();
+        str << wxT("\"");
     }
 
     if (!attr.GetCharacterStyleName().empty())
@@ -992,6 +996,10 @@ wxString wxRichTextXMLHandler::CreateStyle(const wxTextAttrEx& attr, bool isPara
         {
             str << wxT(" pagebreak=\"1\"");
         }
+
+        if (attr.HasOutlineLevel())
+            str << wxT(" outlinelevel=\"") << (int) attr.GetOutlineLevel() << wxT("\"");
+
     }
 
     return str;
@@ -1082,6 +1090,12 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
         attr.SetTextEffects(wxAtoi(value));
     }
 
+    value = node->GetPropVal(wxT("texteffectflags"), wxEmptyString);
+    if (!value.IsEmpty())
+    {
+        attr.SetTextEffectFlags(wxAtoi(value));
+    }
+
     // Set paragraph attributes
     if (isPara)
     {
@@ -1185,6 +1199,12 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
         {
             attr.SetPageBreak(wxAtoi(value) != 0);
         }
+
+        value = node->GetPropVal(wxT("outlinelevel"), wxEmptyString);
+        if (!value.IsEmpty())
+        {
+            attr.SetOutlineLevel(wxAtoi(value) != 0);
+        }
     }
 
     return true;