* Source/NSBox.m (-calcSizesAllowingNegative): Protect against

_cell being nil.
* Source/NSBox.m (-initWithCoder:): Add a few default values.
* Source/NSMenu.m (-_setGeometry): Protect against _aWindow
  being nil.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38003 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2014-07-21 08:04:32 +00:00
parent 80cac045e1
commit 77ef14dcd8
3 changed files with 43 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2014-07-04 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSBox.m (-calcSizesAllowingNegative): Protect against
_cell being nil.
* Source/NSBox.m (-initWithCoder:): Add a few default values.
* Source/NSMenu.m (-_setGeometry): Protect against _aWindow being nil.
2014-07-04 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSWindowDecorationView.m (-changeWindowHeight:): Add

View file

@ -572,6 +572,10 @@
[self setBorderType: borderType];
}
else
{
_border_type = NSGrooveBorder;
}
if ([aDecoder containsValueForKey: @"NSTitlePosition"])
{
NSTitlePosition titlePosition = [aDecoder decodeIntForKey:
@ -579,6 +583,10 @@
[self setTitlePosition: titlePosition];
}
else
{
_title_position = NSAtTop;
}
if ([aDecoder containsValueForKey: @"NSTransparent"])
{
// On Apple this is always NO, we keep it for old GNUstep archives
@ -598,12 +606,27 @@
ASSIGN(_cell, titleCell);
}
else
{
_cell = [[NSCell alloc] initTextCell: @"Title"];
[_cell setAlignment: NSCenterTextAlignment];
[_cell setBordered: NO];
[_cell setEditable: NO];
[self setTitleFont: [NSFont systemFontOfSize:
[NSFont smallSystemFontSize]]];
}
if ([aDecoder containsValueForKey: @"NSContentView"])
{
NSView *contentView = [aDecoder decodeObjectForKey: @"NSContentView"];
[self setContentView: contentView];
}
else
{
NSView *cv = [NSView new];
[self setContentView: cv];
RELEASE(cv);
}
}
else
{
@ -662,6 +685,12 @@
return r;
}
// Don't try to compute anything while the title cell hasn't been set.
if (_cell == nil)
{
return r;
}
switch (_title_position)
{
case NSNoTitle:

View file

@ -501,11 +501,14 @@ static BOOL menuBarVisible = YES;
}
}
origin = NSMakePoint(0, [[_aWindow screen] visibleFrame].size.height
- [_aWindow frame].size.height);
if ((_aWindow != nil) && ([_aWindow screen] != nil))
{
origin = NSMakePoint(0, [[_aWindow screen] visibleFrame].size.height
- [_aWindow frame].size.height);
[_aWindow setFrameOrigin: origin];
[_bWindow setFrameOrigin: origin];
[_aWindow setFrameOrigin: origin];
[_bWindow setFrameOrigin: origin];
}
}
}