From 4cb2dc5b7e2c9e739b39dbbd13a45b5495007e79 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 4 Sep 2007 14:20:22 +0000 Subject: [PATCH] Fixed URL saving/loading git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextxml.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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);