diff --git a/src/richtext/richtextxml.cpp b/src/richtext/richtextxml.cpp index fe16bfaca7..62e31144a3 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -928,6 +928,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()) @@ -972,9 +975,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("\""); @@ -1098,6 +1098,10 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is attr.SetTextEffectFlags(wxAtoi(value)); } + value = node->GetPropVal(wxT("url"), wxEmptyString); + if (!value.empty()) + attr.SetURL(value); + // Set paragraph attributes if (isPara) { @@ -1171,10 +1175,6 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is if (!value.empty()) attr.SetBulletName(value); - value = node->GetPropVal(wxT("url"), wxEmptyString); - if (!value.empty()) - attr.SetURL(value); - value = node->GetPropVal(wxT("parstyle"), wxEmptyString); if (!value.empty()) attr.SetParagraphStyleName(value);