diff options
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r-- | Source/SPTableContent.m | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 6213549d..064b08f1 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -2498,10 +2498,19 @@ } else { NSBeep(); } - [tableValues replaceRowAtIndex:currentlyEditingRow withRowContents:oldRow]; + + // If creating a new row, remove the row; otherwise revert the row contents + if (isEditingNewRow) { + tableRowsCount--; + [tableValues removeRowAtIndex:currentlyEditingRow]; + [self updateCountText]; + isEditingNewRow = NO; + } else { + [tableValues replaceRowAtIndex:currentlyEditingRow withRowContents:oldRow]; + } isEditingRow = NO; - isEditingNewRow = NO; currentlyEditingRow = -1; + [tableContentView reloadData]; [[SPQueryController sharedQueryController] showErrorInConsole:NSLocalizedString(@"/* WARNING: No rows have been affected */\n", @"warning shown in the console when no rows have been affected after writing to the db") connection:[tableDocumentInstance name]]; return YES; |