mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Make sure a decoded control always has a cell.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27122 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2f2292f703
commit
9045dcf521
2 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2008-11-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSControl.m (-initWithCoder:): For keyed decoding make
|
||||
sure there always is a cell.
|
||||
|
||||
2008-11-23 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSTextView.m (-mouseDown:): Allow click into the current
|
||||
|
|
|
@ -971,7 +971,11 @@ static NSNotificationCenter *nc;
|
|||
|
||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||
{
|
||||
[super initWithCoder: aDecoder];
|
||||
self = [super initWithCoder: aDecoder];
|
||||
if (self == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
if ([aDecoder allowsKeyedCoding])
|
||||
{
|
||||
|
@ -981,6 +985,15 @@ static NSNotificationCenter *nc;
|
|||
{
|
||||
[self setCell: cell];
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is needed for subclasses without cells, like NSColorWeel
|
||||
// as we store some properties only on the cell.
|
||||
NSCell *cell = [[[self class] cellClass] new];
|
||||
|
||||
[self setCell: cell];
|
||||
RELEASE(cell);
|
||||
}
|
||||
if ([aDecoder containsValueForKey: @"NSEnabled"])
|
||||
{
|
||||
[self setEnabled: [aDecoder decodeBoolForKey: @"NSEnabled"]];
|
||||
|
|
Loading…
Reference in a new issue