Make NSLayoutManager attributes and flags persistent when using a

keyed archiver, i.e., saving or loading a .nib file.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30490 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2010-05-30 17:51:29 +00:00
parent 8f800dd3ed
commit 424440dd30
2 changed files with 30 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2010-05-30 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSLayoutManager.m (-encodeWithCoder:, -initWithCoder:):
Make layout manager attributes and flags persistent when using a
keyed archiver, i.e., saving or loading a .nib file.
2010-05-29 12:00-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Source/NSSplitView.m: In mouseDown: initialize p and op to

View file

@ -2307,6 +2307,24 @@ no_soft_invalidation:
}
- (void) encodeWithCoder: (NSCoder*)aCoder
{
if ([aCoder allowsKeyedCoding])
{
int flags =
// FIXME attribute not yet supported by GNUstep
//defaultAttachementScaling |
(backgroundLayoutEnabled ? 0x04 : 0) |
(showsInvisibleCharacters ? 0x08 : 0) |
(showsControlCharacters ? 0x10 : 0);
[aCoder encodeObject: [self textContainers] forKey: @"NSTextContainers"];
[aCoder encodeObject: [self textStorage] forKey: @"NSTextStorage"];
[aCoder encodeObject: [self delegate] forKey: @"NSDelegate"];
[aCoder encodeInt: flags forKey: @"NSLMFlags"];
}
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
self = [self init];
@ -2322,9 +2340,12 @@ no_soft_invalidation:
if ([aDecoder containsValueForKey: @"NSLMFlags"])
{
flags = [aDecoder decodeIntForKey: @"NSLMFlags"];
// nothing really to do with these flags....
// they are runtime flags which, even if set into the archive
// they are ignored...
// FIXME attribute not yet supported by GNUstep
//defaultAttachementScaling = (NSImageScaling)(flags & 0x03);
backgroundLayoutEnabled = (flags & 0x04) != 0;
showsInvisibleCharacters = (flags & 0x08) != 0;
showsControlCharacters = (flags & 0x10) != 0;
}
[self setDelegate: delegate];
[storage addLayoutManager: self];