Author: rmottola
Date: Fri May 20 08:42:28 2016
New Revision: 39795

URL: http://svn.gna.org/viewcvs/gnustep?rev=39795&view=rev
Log:
Optimize case for nil label and thus fix crasher on SPARCs

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Source/NSTabViewItem.m

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=39795&r1=39794&r2=39795&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Fri May 20 08:42:28 2016
@@ -1,3 +1,8 @@
+2016-05-20 Riccardo Mottola <[email protected]>
+
+       * Source/NSTabViewItem.m
+       Optimize case for nil label and thus fix crasher on SPARCs
+
 2016-05-13 Eric Heintzmann <[email protected]>
 
         * Tests/GNUmakefile:

Modified: libs/gui/trunk/Source/NSTabViewItem.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSTabViewItem.m?rev=39795&r1=39794&r2=39795&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSTabViewItem.m       (original)
+++ libs/gui/trunk/Source/NSTabViewItem.m       Fri May 20 08:42:28 2016
@@ -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 <[email protected]>
    Date: 1999
@@ -98,11 +98,16 @@
 
 - (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) 
     {
@@ -177,6 +182,9 @@
 {
   NSDictionary *attr;
   NSString *string;
+
+  if (nil == _label)
+    return;
 
   _rect = tabRect;
 


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to