From 81dca137319ed18b1299f77b580ed62b1ecf0fc0 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 8 Mar 2011 10:40:36 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20bug=20if=20user=20invokes=20undo=20?= =?UTF-8?q?on=20a=20NSSearchField=20in=20the=20ContentView=20-=20fixes=20i?= =?UTF-8?q?996=20-=20discussion:=20why=20do=20we=20need=20[NSWindow=20endE?= =?UTF-8?q?ditingFor:]=20=3F=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPTableContent.m | 7 +++++-- 1 file 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; -- cgit v1.2.3