GNOME Bugzilla – Bug 337653
GtkTextBuffer: Split existing tags when pasting tich text
Last modified: 2006-04-10 20:39:41 UTC
When pasting rich text, and there are tags active at the insertion point, the pasted text will have these tags applied after pasting. This is wrong since rich text copy&paste is meant to preserve formatting, otherwise it would be useless and unpredictable. The solution is to figure what tags are active at the insertion iter, and split their ranges so that only the original text before and after the pasted segment is affected by the tags. Patch follows.
Created attachment 62932 [details] [review] Patch fixing the bug
thanks mitch. the patch looks good to me. aside from extra empty newlines within for(...\n...\n...) maybe ;)
Yes, looks good, technically. Stylistically, I agree with Tim on the newlines.
Fixed in CVS, the mentioned newlines removed: 2006-04-10 Michael Natterer <mitch@imendio.com> * gtk/gtktextbufferrichtext.c (gtk_text_buffer_deserialize): pasted rich text should not be affected by tags that are active at the insertion point. Therefore, remove and remember all active tags, and re-apply them left and right of the inserted text after pasting. Fixes bug #337653.