aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableContent.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2011-03-08 10:40:36 +0000
committerBibiko <bibiko@eva.mpg.de>2011-03-08 10:40:36 +0000
commit81dca137319ed18b1299f77b580ed62b1ecf0fc0 (patch)
tree0c1687bffc692a03df8109439d029f6701043b1f /Source/SPTableContent.m
parent72dac790e199a8c1f5043261bb60c7340c9b96ff (diff)
downloadsequelpro-81dca137319ed18b1299f77b580ed62b1ecf0fc0.tar.gz
sequelpro-81dca137319ed18b1299f77b580ed62b1ecf0fc0.tar.bz2
sequelpro-81dca137319ed18b1299f77b580ed62b1ecf0fc0.zip
• fixed bug if user invokes undo on a NSSearchField in the ContentView
- fixes i996 - discussion: why do we need [NSWindow endEditingFor:] ??
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r--Source/SPTableContent.m7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 5f5de871..c4eb9f57 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -2645,8 +2645,11 @@
return YES;
}
- // Save any edits which have been made but not saved to the table yet.
- [[tableDocumentInstance parentWindow] endEditingFor:nil];
+ // Save any edits which have been made but not saved to the table yet;
+ // but not for any NSSearchFields which could cause a crash for undo, redo.
+ if([[[tableDocumentInstance parentWindow] firstResponder] respondsToSelector:@selector(delegate)]
+ && ![[[[tableDocumentInstance parentWindow] firstResponder] delegate] isKindOfClass:[NSSearchField class]])
+ [[tableDocumentInstance parentWindow] endEditingFor:nil];
// If no rows are currently being edited, or a save is in progress, return success at once.
if (!isEditingRow || isSavingRow) return YES;