From e541ba3bc3d57965e72f2e9307e58ad3b085a43e Mon Sep 17 00:00:00 2001 From: wlux Date: Mon, 15 Feb 2010 07:57:11 +0000 Subject: [PATCH] Update the typing attributes of a rich text view also if the selected range has a non-zero length. Fixes a problem where, e.g., corrections from the spell panel could use wrong attributes. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29635 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/NSTextView.m | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index 36273b970..42686df75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-02-15 Wolfgang Lux + + * Source/NSTextView.m (-setSelectedRange:affinity:stillSelecting:): + Update the typing attributes of a rich text view also if the + selected range has a non-zero length. Fixes a problem where, e.g., + corrections from the spell panel could use wrong attributes. + 2010-02-14 Quentin Mathe * Source/GSDragView.m (-_handleDrag:slidePoint:): Fixed to create a diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 641de6b59..eee1cb998 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -3562,6 +3562,17 @@ afterString in order over charRange. // Store the selected text in the selection pasteboard [self copySelection]; + if (_tf.is_rich_text) + { + NSDictionary *dict; + + /* always set the typing attributes to the attributes of the + first selected character */ + dict = [_textStorage attributesAtIndex: charRange.location + effectiveRange: NULL]; + [self setTypingAttributes: dict]; + } + /* TODO: insertion point */ } else /* no selection, only insertion point */