From 03cd212405b8d426c14cf24f2d11a40483d79550 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 4 Sep 2007 14:21:29 +0000 Subject: [PATCH] Fixed URL saving/loading git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48558 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 c5759c78cc..b2ebd5e3cb 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -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); -- 2.45.2