mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 11:20:58 +00:00
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:
parent
08f6f9444f
commit
7d51e97712
2 changed files with 17 additions and 4 deletions
|
@ -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>
|
2016-05-13 Eric Heintzmann <heintzmann.eric@free.fr>
|
||||||
|
|
||||||
* Tests/GNUmakefile:
|
* Tests/GNUmakefile:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/** <title>NSTabViewItem</title>
|
/** <title>NSTabViewItem</title>
|
||||||
|
|
||||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
Copyright (C) 2000-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Author: Michael Hanni <mhanni@sprintmail.com>
|
Author: Michael Hanni <mhanni@sprintmail.com>
|
||||||
Date: 1999
|
Date: 1999
|
||||||
|
@ -98,12 +98,17 @@
|
||||||
|
|
||||||
- (NSSize) sizeOfLabel: (BOOL)shouldTruncateLabel
|
- (NSSize) sizeOfLabel: (BOOL)shouldTruncateLabel
|
||||||
{
|
{
|
||||||
NSDictionary * attr = [[NSDictionary alloc] initWithObjectsAndKeys:
|
NSDictionary * attr;
|
||||||
[_tabview font], NSFontAttributeName,
|
|
||||||
nil];
|
|
||||||
NSString *string;
|
NSString *string;
|
||||||
NSSize rSize;
|
NSSize rSize;
|
||||||
|
|
||||||
|
if (nil == _label)
|
||||||
|
return NSZeroSize;
|
||||||
|
|
||||||
|
attr = [[NSDictionary alloc] initWithObjectsAndKeys:
|
||||||
|
[_tabview font], NSFontAttributeName,
|
||||||
|
nil];
|
||||||
|
|
||||||
if (shouldTruncateLabel)
|
if (shouldTruncateLabel)
|
||||||
{
|
{
|
||||||
string = [self _truncatedLabel];
|
string = [self _truncatedLabel];
|
||||||
|
@ -178,6 +183,9 @@
|
||||||
NSDictionary *attr;
|
NSDictionary *attr;
|
||||||
NSString *string;
|
NSString *string;
|
||||||
|
|
||||||
|
if (nil == _label)
|
||||||
|
return;
|
||||||
|
|
||||||
_rect = tabRect;
|
_rect = tabRect;
|
||||||
|
|
||||||
if (shouldTruncateLabel)
|
if (shouldTruncateLabel)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue