Revision: 6586
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6586&view=rev
Author:   hofman
Date:     2010-06-10 11:13:33 +0000 (Thu, 10 Jun 2010)

Log Message:
-----------
avoid switch and local variable

Modified Paths:
--------------
    trunk/SKNoteOutlineView.m

Modified: trunk/SKNoteOutlineView.m
===================================================================
--- trunk/SKNoteOutlineView.m   2010-06-10 10:16:54 UTC (rev 6585)
+++ trunk/SKNoteOutlineView.m   2010-06-10 11:13:33 UTC (rev 6586)
@@ -63,30 +63,17 @@
     id item = [self itemAtRow:row];
     NSPoint startPoint = [self convertPoint:[theEvent locationInWindow] 
fromView:nil];
     CGFloat startHeight = [[self delegate] outlineView:self 
heightOfRowByItem:item];
-       BOOL keepGoing = YES;
        
     [[NSCursor resizeUpDownCursor] push];
     
-       while (keepGoing) {
+       while ([theEvent type] != NSLeftMouseUp) {
                theEvent = [[self window] nextEventMatchingMask: 
NSLeftMouseUpMask | NSLeftMouseDraggedMask];
-               switch ([theEvent type]) {
-                       case NSLeftMouseDragged:
-            {
-                NSPoint currentPoint = [self convertPoint:[theEvent 
locationInWindow] fromView:nil];
-                CGFloat currentHeight = fmax([self rowHeight], startHeight + 
currentPoint.y - startPoint.y);
-                
-                [[self delegate] outlineView:self setHeightOfRow:currentHeight 
byItem:item];
-                [self noteHeightOfRowsWithIndexesChanged:[NSIndexSet 
indexSetWithIndex:row]];
-                
-                break;
-                       }
+               if ([theEvent type] == NSLeftMouseDragged) {
+            NSPoint currentPoint = [self convertPoint:[theEvent 
locationInWindow] fromView:nil];
+            CGFloat currentHeight = fmax([self rowHeight], startHeight + 
currentPoint.y - startPoint.y);
             
-            case NSLeftMouseUp:
-                keepGoing = NO;
-                break;
-                       
-            default:
-                break;
+            [[self delegate] outlineView:self setHeightOfRow:currentHeight 
byItem:item];
+            [self noteHeightOfRowsWithIndexesChanged:[NSIndexSet 
indexSetWithIndex:row]];
         }
     }
     [NSCursor pop];


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to