hit test processed with row == -1

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@37360 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2013-11-04 16:37:06 +00:00
parent e1498b311a
commit 7bfd4dfad0

View file

@ -3633,11 +3633,15 @@ static inline float computePeriod(NSPoint mouseLocationWin,
- (NSUInteger)_hitTestForEvent:(NSEvent*)event atColumn:(NSInteger)column row:(NSInteger)row
{
NSCell *cell = [self preparedCellAtColumn: column row: row];
NSRect cellFrame = [self frameOfCellAtColumn:(column == -1) ? 0 : column row:row];
// Return the hit result...
return([cell hitTestForEvent:event inRect:cellFrame ofView:self]);
if (row >= 0)
{
NSCell *cell = [self preparedCellAtColumn: column row: row];
NSRect cellFrame = [self frameOfCellAtColumn:(column == -1) ? 0 : column row:row];
// Return the hit result...
return([cell hitTestForEvent:event inRect:cellFrame ofView:self]);
}
return(NSCellHitNone);
}
- (void) mouseDown: (NSEvent *)theEvent
@ -3670,7 +3674,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
_clickedRow = [self rowAtPoint: location];
_clickedColumn = [self columnAtPoint: location];
if ([theEvent type] == NSLeftMouseDown)
if ((_clickedRow != -1) && ([theEvent type] == NSLeftMouseDown))
{
// If the cell processed the mouse hit...
NSInteger theColumn = _clickedColumn;