Revision: 15469 http://sourceforge.net/p/skim-app/code/15469 Author: hofman Date: 2025-06-16 09:20:22 +0000 (Mon, 16 Jun 2025) Log Message: ----------- avoid local variable shadowing ivar
Modified Paths: -------------- trunk/SKOverviewView.m Modified: trunk/SKOverviewView.m =================================================================== --- trunk/SKOverviewView.m 2025-06-15 16:24:55 UTC (rev 15468) +++ trunk/SKOverviewView.m 2025-06-16 09:20:22 UTC (rev 15469) @@ -92,13 +92,13 @@ } - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - SEL action = [menuItem action]; - if (action == @selector(copy:) || action == @selector(copyURL:)) { + SEL itemAction = [menuItem action]; + if (itemAction == @selector(copy:) || itemAction == @selector(copyURL:)) { NSUInteger i = [[self selectionIndexes] firstIndex]; if (i == NSNotFound) return NO; id view = [[self itemAtIndex:i] view]; - if ([view respondsToSelector:action] == NO) + if ([view respondsToSelector:itemAction] == NO) return NO; if ([view respondsToSelector:_cmd]) return [view validateMenuItem:menuItem]; @@ -113,15 +113,12 @@ } - (void)mouseDown:(NSEvent *)theEvent { - SEL action = (([theEvent clickCount] == 1 && [self sendActionOnSingleClick]) || [theEvent clickCount] == 2) ? [self action] : NULL; + BOOL shouldSendAction = [self action] && (([theEvent clickCount] == 1 && [self sendActionOnSingleClick]) || [theEvent clickCount] == 2) && [NSApp willDragMouse] == NO; - if (action && [NSApp willDragMouse]) - action = NULL; - [super mouseDown:theEvent]; - if (action) - DISPATCH_MAIN_AFTER_SEC(0.01, ^{ [self tryToPerform:action with:self]; }); + if (shouldSendAction) + DISPATCH_MAIN_AFTER_SEC(0.01, ^{ [self tryToPerform:[self action] with:self]; }); } - (id)newViewWithIdentifier:(NSString *)identifier { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit