aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructure.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-08-26 22:45:05 +0000
committerrowanbeentje <rowan@beent.je>2013-08-26 22:45:05 +0000
commitd99de6f4c04fa0da1575963d161182c92cf3721f (patch)
tree64d52d6152a1388ea5aaa47d6d1a6a5caafe7b5f /Source/SPTableStructure.m
parenta401c044675a24d9ee0508b6014cc691349485e9 (diff)
downloadsequelpro-d99de6f4c04fa0da1575963d161182c92cf3721f.tar.gz
sequelpro-d99de6f4c04fa0da1575963d161182c92cf3721f.tar.bz2
sequelpro-d99de6f4c04fa0da1575963d161182c92cf3721f.zip
- Fix occasional exceptions when saves of new fields in the table structure fail (http://spbug.com/l/2500, http://spbug.com/l/2281, http://spbug.com/l/2046)
Diffstat (limited to 'Source/SPTableStructure.m')
-rw-r--r--Source/SPTableStructure.m13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m
index f5879f4e..cd034a6d 100644
--- a/Source/SPTableStructure.m
+++ b/Source/SPTableStructure.m
@@ -683,13 +683,6 @@
if (!isEditingRow || isSavingRow) return YES;
isSavingRow = YES;
- // Save any edits which have been made but not saved to the table yet.
-#ifndef SP_CODA /* patch */
- [[tableDocumentInstance parentWindow] endEditingFor:nil];
-#else
- [[tableSourceView window] endEditingFor:nil];
-#endif
-
// Attempt to save the row, and return YES if the save succeeded.
if ([self addRowToDB]) {
isSavingRow = NO;
@@ -712,6 +705,12 @@
if (alertSheetOpened) return NO;
+ // Save any edits which have been started but not saved to the underlying table/data structures
+ // yet - but not if currently undoing/redoing, as this can cause a processing loop
+ if (![[[[tableSourceView window] firstResponder] undoManager] isUndoing] && ![[[[tableSourceView window] firstResponder] undoManager] isRedoing]) {
+ [[tableSourceView window] endEditingFor:nil];
+ }
+
NSMutableString *queryString;
BOOL fieldDefIncludesLen = NO;