diff options
Diffstat (limited to 'Source/SPCopyTable.m')
-rw-r--r-- | Source/SPCopyTable.m | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index c8a32f00..513421a0 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -738,27 +738,36 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; // RETURN or ENTER invoke editing mode for selected row // by calling tableView:shouldEditTableColumn: to validate - if([self numberOfSelectedRows] == 1 && ([theEvent keyCode] == 36 || [theEvent keyCode] == 76)) { - for(id item in [self tableColumns]) { - // Run in fieldEditorMode? - if(![[self delegate] tableView:self shouldEditTableColumn:item row:[self selectedRow]]) - ; - else { - [self editColumn:0 row:[self selectedRow] withEvent:nil select:YES]; - break; + // TODO: find a better solution HansJB + if([self numberOfSelectedRows] == 1 && ([theEvent keyCode] == 36 || [theEvent keyCode] == 76)) { + if([[self delegate] isKindOfClass:[SPCustomQuery class]] || [[self delegate] isKindOfClass:[SPTableContent class]]) { + ; + } else { + for(id item in [self tableColumns]) { + // Run in fieldEditorMode? + if(![[self delegate] tableView:self shouldEditTableColumn:item row:[self selectedRow]]) + ; + else { + [self editColumn:0 row:[self selectedRow] withEvent:nil select:YES]; + break; + } } } - return; } - + // Check if ESCAPE is hit and use it to cancel row editing if supported - else if ([theEvent keyCode] == 53 && [[self delegate] respondsToSelector:@selector(cancelRowEditing)]) + if ([theEvent keyCode] == 53 && [[self delegate] respondsToSelector:@selector(cancelRowEditing)]) { if ([[self delegate] cancelRowEditing]) return; } - + + // TODO: find a better solution HansJB + else if ([theEvent keyCode] == 48 && ([[self delegate] isKindOfClass:[SPCustomQuery class]] + || [[self delegate] isKindOfClass:[SPTableContent class]])) { + return; + } [super keyDown:theEvent]; } |