aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPCopyTable.m16
-rw-r--r--Source/SPCustomQuery.m13
-rw-r--r--Source/SPTableContent.m13
3 files changed, 23 insertions, 19 deletions
diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m
index 21a1bd7f..98dd45aa 100644
--- a/Source/SPCopyTable.m
+++ b/Source/SPCopyTable.m
@@ -739,21 +739,8 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003;
// RETURN or ENTER invoke editing mode for selected row
// by calling tableView:shouldEditTableColumn: to validate
- // 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]]) {
- [self editColumn:0 row:[self selectedRow] withEvent:nil select:YES];;
- } 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;
- }
- }
- }
+ [self editColumn:0 row:[self selectedRow] withEvent:nil select:YES];
return;
}
@@ -763,7 +750,6 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003;
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]])) {
[self editColumn:0 row:[self selectedRow] withEvent:nil select:YES];
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 5eea9f6f..011cdc09 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -3408,9 +3408,15 @@
- (void)processFieldEditorResult:(id)data contextInfo:(NSDictionary*)contextInfo
{
+ NSInteger row = -1;
+ NSInteger column = -1;
+
+ if(contextInfo) {
+ row = [[contextInfo objectForKey:@"row"] integerValue];
+ column = [[contextInfo objectForKey:@"column"] integerValue];
+ }
+
if (data && contextInfo) {
- NSUInteger row = [[contextInfo objectForKey:@"row"] integerValue];
- NSUInteger column = [[contextInfo objectForKey:@"column"] integerValue];
BOOL isFieldEditable = ([contextInfo objectForKey:@"isFieldEditable"]) ? YES : NO;
if(isFieldEditable) {
@@ -3428,6 +3434,9 @@
if (selectionIndexToRestore)
[customQueryView selectRowIndexes:selectionIndexToRestore byExtendingSelection:NO];
+ if(row > -1 && column > -1)
+ [customQueryView editColumn:column row:row withEvent:nil select:YES];
+
}
#pragma mark -
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index c71099b8..19d9a6b6 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -2884,9 +2884,15 @@
- (void)processFieldEditorResult:(id)data contextInfo:(NSDictionary*)contextInfo
{
+ NSInteger row = -1;
+ NSInteger column = -1;
+
+ if(contextInfo) {
+ row = [[contextInfo objectForKey:@"row"] integerValue];
+ column = [[contextInfo objectForKey:@"column"] integerValue];
+ }
+
if (data && contextInfo) {
- NSUInteger row = [[contextInfo objectForKey:@"row"] integerValue];
- NSUInteger column = [[contextInfo objectForKey:@"column"] integerValue];
BOOL isFieldEditable = ([contextInfo objectForKey:@"isFieldEditable"]) ? YES : NO;
if (!isEditingRow && [tablesListInstance tableType] != SPTableTypeView) {
[oldRow setArray:[tableValues rowContentsAtIndex:row]];
@@ -2918,6 +2924,9 @@
}
[[tableDocumentInstance parentWindow] makeFirstResponder:tableContentView];
+
+ if(row > -1 && column > -1)
+ [tableContentView editColumn:column row:row withEvent:nil select:YES];
}
#pragma mark -