Author: fredkiefer
Date: Thu Mar  5 23:05:17 2015
New Revision: 38382

URL: http://svn.gna.org/viewcvs/gnustep?rev=38382&view=rev
Log:
* Source/NSCollectionView.m (-drawRect:): Work around strange
  behaviour of compiler.

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

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=38382&r1=38381&r2=38382&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Thu Mar  5 23:05:17 2015
@@ -1,3 +1,8 @@
+2015-03-05 Fred Kiefer <[email protected]>
+
+       * Source/NSCollectionView.m (-drawRect:): Work around strange
+       behaviour of compiler.
+
 2015-03-05 Fred Kiefer <[email protected]>
 
        * Source/NSImageView.m (-initWithFrame:): Set default for 
AllowsCutCopyPaste.

Modified: libs/gui/trunk/Source/NSCollectionView.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSCollectionView.m?rev=38382&r1=38381&r2=38382&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSCollectionView.m    (original)
+++ libs/gui/trunk/Source/NSCollectionView.m    Thu Mar  5 23:05:17 2015
@@ -151,8 +151,11 @@
   NSPoint oppositeOrigin = NSMakePoint (origin.x + size.width, origin.y + 
size.height);
   
   NSInteger firstIndexInRect = MAX(0, [self _indexAtPoint: origin]);
-  NSInteger lastIndexInRect = MIN([_items count] - 1, [self _indexAtPoint: 
oppositeOrigin]);
-  NSInteger index;
+  // I had to extract these values from the macro to get it
+  // working correctly.
+  NSInteger index = [self _indexAtPoint: oppositeOrigin];
+  NSInteger last = [_items count] - 1;
+  NSInteger lastIndexInRect = MIN(last, index);
 
   for (index = firstIndexInRect; index <= lastIndexInRect; index++)
     {


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

Reply via email to