Fixed -encodeWithCoder: in NSView to encode the superview conditionally as Cocoa

does (Apple discusses  superview encoding as a use case for conditional encoding 
in the Archiving related documentation).

Note: A view can now be archived (or copied) without having to remove the view 
from its hierarchy before archiving it.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36065 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
qmathe 2013-02-06 17:28:52 +00:00
parent ec16871d00
commit d50fcc77d9
2 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2013-02-06 Quentin Mathe <quentin.mathe@gmail.com>
* Source/NSView.m (-encodeWithCoder:): Fixed to encode the superview
conditionally as Cocoa does (Apple discusses superview encoding as a
use case for conditional encoding in the Archiving related documentation).
View can now be archived (or copied) without having to remove the view
from its hierarchy before archiving it.
2013-02-05 Fred Kiefer <FredKiefer@gmx.de>
* Headers/Additions/GNUstepGUI/GSMethodTable.h

View file

@ -4566,7 +4566,7 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level)
//
if (([[self window] contentView] != self) && _super_view != nil)
{
[aCoder encodeObject: _super_view forKey: @"NSSuperview"];
[aCoder encodeConditionalObject: _super_view forKey: @"NSSuperview"];
}
}
else