Added code to encodeWithCoder: in NSButtonCell to allow encoding of previous version of the class to the archive.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25415 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2007-08-25 02:36:02 +00:00
parent a5a21eb966
commit 251a90b819
2 changed files with 37 additions and 18 deletions

View file

@ -1,3 +1,8 @@
2007-08-24 22:33-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSButtonCell.m: Added code in encodeWithCoder: to allow
encoding previous versions of the object to the archive.
2007-08-22 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSFontPanel.h: Add MacOSX 10.3 constants.

View file

@ -1610,13 +1610,26 @@ typedef struct _GSButtonCellFlags
tmp = _buttoncell_is_transparent;
[aCoder encodeValueOfObjCType: @encode(BOOL)
at: &tmp];
if([NSButtonCell version] <= 2)
{
unsigned int ke = _keyEquivalentModifierMask << 16;
[aCoder encodeValueOfObjCType: @encode(unsigned int)
at: &ke];
}
else
{
[aCoder encodeValueOfObjCType: @encode(unsigned int)
at: &_keyEquivalentModifierMask];
}
[aCoder encodeValueOfObjCType: @encode(unsigned int)
at: &_highlightsByMask];
[aCoder encodeValueOfObjCType: @encode(unsigned int)
at: &_showAltStateMask];
if([NSButtonCell version] >= 2)
{
[aCoder encodeObject: _sound];
[aCoder encodeObject: _backgroundColor];
[aCoder encodeValueOfObjCType: @encode(float)
@ -1634,6 +1647,7 @@ typedef struct _GSButtonCellFlags
[aCoder encodeValueOfObjCType: @encode(BOOL)
at: &tmp];
}
}
}
- (id) initWithCoder: (NSCoder*)aDecoder