X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bafc4eacc4e0bb58c67014348a5cd4a01b69853f..3f7564f229450a9c036141878ee75cc09078a945:/src/richtext/richtextbuffer.cpp diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 8a4b4929f6..1a6186778f 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -1447,7 +1447,6 @@ bool wxRichTextCompositeObject::Defragment(wxRichTextDrawingContext& context, co if (node->GetNext()) { wxRichTextObject* nextChild = node->GetNext()->GetData(); - wxRichTextObjectList::compatibility_iterator nextNode = node->GetNext(); // First split child and nextChild so we have smaller fragments to merge. // Then Merge only has to test per-object virtual attributes @@ -3319,7 +3318,17 @@ bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const wxRichTextRemoveStyle(child->GetAttributes(), style); } else if (resetExistingStyle) + { + // Preserve the URL as it's not really a formatting style but a property of the object + wxString url; + if (child->GetAttributes().HasURL() && !characterAttributes.HasURL()) + url = child->GetAttributes().GetURL(); + child->GetAttributes() = characterAttributes; + + if (!url.IsEmpty()) + child->GetAttributes().SetURL(url); + } else { if (applyMinimal)