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
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)