* Source/NSMenuItem.m: encodeWithCoder: only encode the NSSubitems

key if the menu is not owned by a popup.   This avoids an
	assertion error when loading the resulting nib into InterfaceBuilder.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28446 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2009-08-09 03:27:13 +00:00
parent 3a969af071
commit c34154a5ef
2 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2009-08-08 23:26-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Source/NSMenuItem.m: encodeWithCoder: only encode the NSSubitems
key if the menu is not owned by a popup. This avoids an
assertion error when loading the resulting nib into InterfaceBuilder.
2009-08-08 13:06-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Source/NSTextView.m: initWithCoder: change to use text storage

View file

@ -506,9 +506,17 @@ static Class imageClass;
[aCoder encodeObject: _onStateImage forKey: @"NSOnImage"];
[aCoder encodeObject: _offStateImage forKey: @"NSOffImage"]; // ???????
[aCoder encodeObject: _mixedStateImage forKey: @"NSMixedImage"];
[aCoder encodeObject: _target forKey: @"NSTarget"];
[aCoder encodeObject: _target forKey: @"NSTarget"];
[aCoder encodeObject: _menu forKey: @"NSMenu"];
[aCoder encodeObject: _submenu forKey: @"NSSubmenu"];
// If the menu is owned by a popup, then don't encode the children.
// This prevents an assertion error in IB as these keys should not
// be present in a menu item when it's encoded as part of a popup.
if([_menu _ownedByPopUp] == NO)
{
[aCoder encodeObject: _submenu forKey: @"NSSubmenu"];
}
[aCoder encodeInt: _keyEquivalentModifierMask forKey: @"NSKeyEquivModMask"];
[aCoder encodeInt: _mnemonicLocation forKey: @"NSMnemonicLoc"];
[aCoder encodeInt: _state forKey: @"NSState"];