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
This commit is contained in:
Adam Fedor 2000-08-25 14:25:38 +00:00
parent ee791d6194
commit 2a670138e5
2 changed files with 19 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2000-08-25 Adam Fedor <fedor@gnu.org>
* GMAppKit.m ([NSTextView -encodeWithModelArchiver:]): Test if
object responds to allowsUndo.
2000-08-25 Fred Kiefer <FredKiefer@gmx.de>
* 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

View file

@ -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];