Minor cleaning/tidying up in -mouseDown:

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11937 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2002-01-02 09:53:24 +00:00
parent a9ab96ca32
commit df7e037dab

View file

@ -2137,12 +2137,12 @@ afterString in order over charRange. */
startPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil];
startIndex = [self characterIndexForPoint: startPoint];
if ([_textStorage containsAttachments])
{
NSTextAttachment *attachment;
// Check if the click was on an attachment cell
/* Check if the click was on an attachment cell. */
attachment = [_textStorage attribute: NSAttachmentAttributeName
atIndex: startIndex
effectiveRange: NULL];
@ -2150,20 +2150,25 @@ afterString in order over charRange. */
if (attachment != nil)
{
id <NSTextAttachmentCell> cell = [attachment attachmentCell];
// FIXME: Where to get the cellFrame?
NSRect cellFrame = NSMakeRect(0, 0, 0, 0);
if ((cell != nil) &&
([cell wantsToTrackMouseForEvent: theEvent
inRect: cellFrame
ofView: self
atCharacterIndex: startIndex] == YES) &&
([cell trackMouse: theEvent
inRect: cellFrame
ofView: self
atCharacterIndex: startIndex
untilMouseUp: NO] == YES))
return;
if (cell != nil)
{
/* FIXME: Where to get the cellFrame? */
NSRect cellFrame = NSMakeRect(0, 0, 0, 0);
if ([cell wantsToTrackMouseForEvent: theEvent
inRect: cellFrame
ofView: self
atCharacterIndex: startIndex]
&& [cell trackMouse: theEvent
inRect: cellFrame
ofView: self
atCharacterIndex: startIndex
untilMouseUp: NO])
{
return;
}
}
}
}