mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 12:00:52 +00:00
Prevent exception when subview is added at the end of the subview list.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21073 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7036061d5d
commit
daa83e855e
2 changed files with 12 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-04-08 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSView.m (-addSubview:positioned:relativeTo:): Don't
|
||||
increase index for subview added at the end. Based on patch by
|
||||
Matthias Hengartner <hengartner@ivt.baug.ethz.ch>.
|
||||
|
||||
2005-04-03 14:53 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Source/NSCustomImageRep.m: Allow drawing if the delegate is
|
||||
|
|
|
@ -474,6 +474,11 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
else
|
||||
index = [_sub_views count];
|
||||
}
|
||||
else if (place != NSWindowBelow)
|
||||
{
|
||||
index += 1;
|
||||
}
|
||||
|
||||
RETAIN(aView);
|
||||
[aView removeFromSuperview];
|
||||
if (aView->_coordinates_valid)
|
||||
|
@ -483,10 +488,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
[aView viewWillMoveToWindow: _window];
|
||||
[aView viewWillMoveToSuperview: self];
|
||||
[aView setNextResponder: self];
|
||||
if (place == NSWindowBelow)
|
||||
[_sub_views insertObject: aView atIndex: index];
|
||||
else
|
||||
[_sub_views insertObject: aView atIndex: index+1];
|
||||
[_sub_views insertObject: aView atIndex: index];
|
||||
_rFlags.has_subviews = 1;
|
||||
[aView resetCursorRects];
|
||||
[aView setNeedsDisplay: YES];
|
||||
|
|
Loading…
Reference in a new issue