]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed URL saving/loading
authorJulian Smart <julian@anthemion.co.uk>
Tue, 4 Sep 2007 14:21:29 +0000 (14:21 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 4 Sep 2007 14:21:29 +0000 (14:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48558 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextxml.cpp

index c5759c78cc03cc1bfe1044602cabdfc4a2f4abef..b2ebd5e3cb79edf726b3230541297db3e8374e3c 100644 (file)
@@ -929,6 +929,9 @@ wxString wxRichTextXMLHandler::CreateStyle(const wxTextAttrEx& attr, bool isPara
     if (!attr.GetCharacterStyleName().empty())
         str << wxT(" characterstyle=\"") << wxString(attr.GetCharacterStyleName()) << wxT("\"");
 
+    if (attr.HasURL())
+        str << wxT(" url=\"") << attr.GetURL() << wxT("\"");
+
     if (isPara)
     {
         if (attr.HasAlignment())
@@ -973,9 +976,6 @@ wxString wxRichTextXMLHandler::CreateStyle(const wxTextAttrEx& attr, bool isPara
         if (attr.HasBulletName())
             str << wxT(" bulletname=\"") << attr.GetBulletName() << wxT("\"");
 
-        if (attr.HasURL())
-            str << wxT(" url=\"") << attr.GetURL() << wxT("\"");
-
         if (!attr.GetParagraphStyleName().empty())
             str << wxT(" parstyle=\"") << wxString(attr.GetParagraphStyleName()) << wxT("\"");
 
@@ -1099,6 +1099,10 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
         attr.SetTextEffectFlags(wxAtoi(value));
     }
 
+    value = node->GetAttribute(wxT("url"), wxEmptyString);
+    if (!value.empty())
+        attr.SetURL(value);
+
     // Set paragraph attributes
     if (isPara)
     {
@@ -1172,10 +1176,6 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
         if (!value.empty())
             attr.SetBulletName(value);
 
-        value = node->GetAttribute(wxT("url"), wxEmptyString);
-        if (!value.empty())
-            attr.SetURL(value);
-
         value = node->GetAttribute(wxT("parstyle"), wxEmptyString);
         if (!value.empty())
             attr.SetParagraphStyleName(value);