Optimize case for nil label and thus fix crasher on SPARCs

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@39795 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2016-05-20 06:42:28 +00:00
parent 1b8dd0b36b
commit 4770b7d6ea
2 changed files with 17 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2016-05-20 Riccardo Mottola <rm@gnu.org>
* Source/NSTabViewItem.m
Optimize case for nil label and thus fix crasher on SPARCs
2016-05-13 Eric Heintzmann <heintzmann.eric@free.fr>
* Tests/GNUmakefile:

View file

@ -1,6 +1,6 @@
/** <title>NSTabViewItem</title>
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright (C) 2000-2016 Free Software Foundation, Inc.
Author: Michael Hanni <mhanni@sprintmail.com>
Date: 1999
@ -98,12 +98,17 @@
- (NSSize) sizeOfLabel: (BOOL)shouldTruncateLabel
{
NSDictionary * attr = [[NSDictionary alloc] initWithObjectsAndKeys:
[_tabview font], NSFontAttributeName,
nil];
NSDictionary * attr;
NSString *string;
NSSize rSize;
if (nil == _label)
return NSZeroSize;
attr = [[NSDictionary alloc] initWithObjectsAndKeys:
[_tabview font], NSFontAttributeName,
nil];
if (shouldTruncateLabel)
{
string = [self _truncatedLabel];
@ -178,6 +183,9 @@
NSDictionary *attr;
NSString *string;
if (nil == _label)
return;
_rect = tabRect;
if (shouldTruncateLabel)