From 423d1f0826a85f00192cb2023eaf92caed1a088c Mon Sep 17 00:00:00 2001 From: gcasa Date: Sat, 8 Aug 2009 17:07:07 +0000 Subject: [PATCH] * Source/NSTextView.m: initWithCoder: change to use text storage more directly to allow the handling of attributed strings. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28445 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSTextView.m | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d7047d79..1ecdc8e6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-08 13:06-EDT Gregory John Casamento + + * Source/NSTextView.m: initWithCoder: change to use text storage + more directly to allow the handling of attributed strings. + 2009-08-08 03:06-EDT Gregory John Casamento * Source/GSTextStorage.m: In initWithCoder: don't overwrite the diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 700735891..d085ca183 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -785,7 +785,7 @@ that makes decoding and encoding compatible with the old code. self = [super initWithCoder: aDecoder]; if ([aDecoder allowsKeyedCoding]) { - NSString *textString = @""; + id textString = nil; if ([aDecoder containsValueForKey: @"NSDelegate"]) { [self setDelegate: [aDecoder decodeObjectForKey: @"NSDelegate"]]; @@ -851,8 +851,8 @@ that makes decoding and encoding compatible with the old code. { NSTextContainer *container = [aDecoder decodeObjectForKey: @"NSTextContainer"]; GSLayoutManager *lm = [container layoutManager]; - NSTextStorage *ts = [lm textStorage]; - textString = [ts string]; + textString = [lm textStorage]; + [self setRichText: YES]; } // set up the text network... @@ -874,7 +874,7 @@ that makes decoding and encoding compatible with the old code. [aDecoder decodeIntForKey: @"NSTVFlags"]; } - [self setString: textString]; + [self insertText: textString]; } else {