From b237cbdc269f83f82913b51b8c6797c485f760f4 Mon Sep 17 00:00:00 2001 From: fedor Date: Fri, 25 Aug 2000 14:25:38 +0000 Subject: [PATCH] FIx NSTextView model trans. View removal git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7245 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 10 ++++++++++ Source/NSView.m | 11 +++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f8b63ddc..140b0eba2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-08-25 Adam Fedor + + * GMAppKit.m ([NSTextView -encodeWithModelArchiver:]): Test if + object responds to allowsUndo. + 2000-08-25 Fred Kiefer * Source/Parser/RTFProducer.m @@ -6,6 +11,11 @@ * Source/Parser/rtfScanner.c Corrected function gethex(). +2000-08-19 Georg Fleischmann + + * gui/Source/NSView.m ([NSView removeSubview:]): check if any + superview of the first responder is the view to be removed + 2000-08-15 Georg Fleischmann * gui/Source/NSText.m ([NSText sizeToFit:]): 'else' removed to diff --git a/Source/NSView.m b/Source/NSView.m index d7cd62492..68667b31f 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -397,13 +397,20 @@ GSSetDragTypes(NSView* obj, NSArray *types) - (void) removeSubview: (NSView*)aSubview { + id view; /* * This must be first because it invokes -resignFirstResponder:, * which assumes the view is still in the view hierarchy */ - if ([_window firstResponder] == aSubview) + for (view = [_window firstResponder]; + view != nil && [view respondsToSelector:@selector(superview)]; + view = [view superview] ) { - [_window makeFirstResponder: _window]; + if (view == aSubview) + { + [_window makeFirstResponder: _window]; + break; + } } aSubview->_super_view = nil; [aSubview viewWillMoveToWindow: nil];