Really commit the NSTextContainer changes of r30491 and not only their

change log.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30497 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2010-05-30 20:57:01 +00:00
parent 029f131d9a
commit f21e9f221d

View file

@ -117,7 +117,7 @@ use bounds rectangle instead of frame? */
- (id) init - (id) init
{ {
return [self initWithContainerSize: NSZeroSize]; return [self initWithContainerSize: NSMakeSize(1e7, 1e7)];
} }
- (void) dealloc - (void) dealloc
@ -465,8 +465,7 @@ framework intact.
{ {
if ([aDecoder allowsKeyedCoding]) if ([aDecoder allowsKeyedCoding])
{ {
NSSize size = NSZeroSize; NSSize size = NSMakeSize(1e7, 1e7);
// NSTextView *view = [aDecoder decodeObjectForKey: @"NSTextView"];
if ([aDecoder containsValueForKey: @"NSWidth"]) if ([aDecoder containsValueForKey: @"NSWidth"])
{ {
@ -478,9 +477,10 @@ framework intact.
int flags = [aDecoder decodeIntForKey: @"NSTCFlags"]; int flags = [aDecoder decodeIntForKey: @"NSTCFlags"];
// decode the flags. // decode the flags.
_widthTracksTextView = flags & 1; _widthTracksTextView = (flags & 1) != 0;
_heightTracksTextView = flags & 2; _heightTracksTextView = (flags & 2) != 0;
_observingFrameChanges = flags & 4; // Mac OS X doesn't seem to save this flag
_observingFrameChanges = _widthTracksTextView | _heightTracksTextView;
} }
// decoding the manager adds this text container automatically... // decoding the manager adds this text container automatically...
@ -489,7 +489,6 @@ framework intact.
_layoutManager = [aDecoder decodeObjectForKey: @"NSLayoutManager"]; _layoutManager = [aDecoder decodeObjectForKey: @"NSLayoutManager"];
} }
// [self setTextView: view];
return self; return self;
} }
else else
@ -508,10 +507,9 @@ framework intact.
((_observingFrameChanges)?4:0); ((_observingFrameChanges)?4:0);
[coder encodeObject: _textView forKey: @"NSTextView"]; [coder encodeObject: _textView forKey: @"NSTextView"];
[coder encodeObject: _layoutManager forKey: @"NSLayoutManager"];
[coder encodeFloat: size.width forKey: @"NSWidth"]; [coder encodeFloat: size.width forKey: @"NSWidth"];
[coder encodeInt: flags forKey: @"NSTCFlags"]; [coder encodeInt: flags forKey: @"NSTCFlags"];
// TODO: Add layout manager encoding, if needed...
} }
} }