Fix some optimistic coding in NSCell which was causing a crash in

AddressManager.app.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29904 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2010-03-11 18:43:15 +00:00
parent ce29b8d726
commit cdf5175e7c
2 changed files with 21 additions and 11 deletions

View file

@ -1,3 +1,10 @@
2010-03-11 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSCell.m (-_drawEditorWithFrame:inView:): Fix some
optimistic coding which expected the controlView argument to
always be a subclass of NSControl and was causing a crash in
AddressManager.app.
2005-03-09 Doug Simons <doug.simons@testplant.com>
* Source/NSMenu.m: Protect changedMessagesEnabled flag against getting

View file

@ -2948,18 +2948,21 @@ static NSColor *dtxtCol;
{
/* Look Ma', no drawing here... */
/* Adjust the text editor's frame to match cell's frame (minus the border) */
NSRect titleRect = [self titleRectForBounds: cellFrame];
NSText *textObject = [(NSControl*)controlView currentEditor];
NSView *clipView = [textObject superview];
if ([controlView isKindOfClass: [NSControl class]])
{
/* Adjust the text editor's frame to match cell's frame (w/o border) */
NSRect titleRect = [self titleRectForBounds: cellFrame];
NSText *textObject = [(NSControl*)controlView currentEditor];
NSView *clipView = [textObject superview];
if ([clipView isKindOfClass: [NSClipView class]])
{
[clipView setFrame: titleRect];
}
else
{
[textObject setFrame: titleRect];
if ([clipView isKindOfClass: [NSClipView class]])
{
[clipView setFrame: titleRect];
}
else
{
[textObject setFrame: titleRect];
}
}
}