diff options
author | Bibiko <bibiko@eva.mpg.de> | 2011-03-08 10:40:36 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2011-03-08 10:40:36 +0000 |
commit | 81dca137319ed18b1299f77b580ed62b1ecf0fc0 (patch) | |
tree | 0c1687bffc692a03df8109439d029f6701043b1f | |
parent | 72dac790e199a8c1f5043261bb60c7340c9b96ff (diff) | |
download | sequelpro-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:] ??
-rw-r--r-- | Source/SPTableContent.m | 7 |
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; |