aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/SPTablesList.m23
1 files changed, 17 insertions, 6 deletions
diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m
index db3890ff..3abde17d 100644
--- a/Source/SPTablesList.m
+++ b/Source/SPTablesList.m
@@ -1709,18 +1709,29 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable";
- (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(NSInteger)rowIndex
{
// Disallow selection while the document is working on a task
- if ([tableDocumentInstance isWorking]) return NO;
+ if ([tableDocumentInstance isWorking]) {
+ return NO;
+ }
// Allow deselections
- if (rowIndex == -1) return YES;
+ if (rowIndex == -1) {
+ return YES;
+ }
+
+ // On 10.6, right-clicking below all rows attempts to select a high row index
+ if (rowIndex >= (NSInteger)[filteredTables count]) {
+ return NO;
+ }
- if(![[filteredTables objectAtIndex:rowIndex] isKindOfClass:[NSString class]])
+ if (![[filteredTables objectAtIndex:rowIndex] isKindOfClass:[NSString class]]) {
return NO;
+ }
- //return (rowIndex != 0);
- if( [filteredTableTypes count] == 0 )
+ if ([filteredTableTypes count] == 0) {
return (rowIndex != 0 );
- return ([[filteredTableTypes objectAtIndex:rowIndex] integerValue] != SPTableTypeNone );
+ }
+
+ return ([[filteredTableTypes objectAtIndex:rowIndex] integerValue] != SPTableTypeNone);
}
/**