mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Fix issue #91, add non-keyed encoding to initWithCoder:/encodeWithCoder
This commit is contained in:
parent
f16f268467
commit
d0dd3331fb
1 changed files with 15 additions and 3 deletions
|
@ -602,11 +602,11 @@ static NSString *placeholderItem = nil;
|
|||
|
||||
if (self)
|
||||
{
|
||||
_itemSize = NSMakeSize(0, 0);
|
||||
_tileWidth = -1.0;
|
||||
|
||||
if ([aCoder allowsKeyedCoding])
|
||||
{
|
||||
_itemSize = NSMakeSize(0, 0);
|
||||
_tileWidth = -1.0;
|
||||
|
||||
_minItemSize = [aCoder decodeSizeForKey: NSCollectionViewMinItemSizeKey];
|
||||
_maxItemSize = [aCoder decodeSizeForKey: NSCollectionViewMaxItemSizeKey];
|
||||
|
||||
|
@ -622,6 +622,12 @@ static NSString *placeholderItem = nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
_minItemSize = [aCoder decodeSize];
|
||||
_maxItemSize = [aCoder decodeSize];
|
||||
[aCoder decodeValueOfObjCType: @encode(int64_t) at: &_maxNumberOfRows];
|
||||
[aCoder decodeValueOfObjCType: @encode(int64_t) at: &_maxNumberOfColumns];
|
||||
[aCoder decodeValueOfObjCType: @encode(BOOL) at: &_isSelectable];
|
||||
[self setBackgroundColors: [aCoder decodeObject]]; // decode color...
|
||||
}
|
||||
}
|
||||
[self _initDefaults];
|
||||
|
@ -660,6 +666,12 @@ static NSString *placeholderItem = nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
[aCoder encodeSize: _minItemSize];
|
||||
[aCoder encodeSize: _maxItemSize];
|
||||
[aCoder encodeValueOfObjCType: @encode(int64_t) at: &_maxNumberOfRows];
|
||||
[aCoder encodeValueOfObjCType: @encode(int64_t) at: &_maxNumberOfColumns];
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isSelectable];
|
||||
[aCoder encodeObject: [self backgroundColors]]; // encode color...
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue