mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 19:10:37 +00:00
Ensure the NSTableView rowAtPoint: method always returns a valid row number.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20584 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d297a62697
commit
90952ec827
2 changed files with 11 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-01-20 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSTableView.m (-rowAtPoint:): If the heigh of the table
|
||||||
|
is incorrect and because of this the row would be greater than the
|
||||||
|
number of rows, return a usable number.
|
||||||
|
|
||||||
2005-01-18 17:06 Alexander Malmberg <alexander@malmberg.org>
|
2005-01-18 17:06 Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
|
||||||
* Source/NSWindow.m
|
* Source/NSWindow.m
|
||||||
|
|
|
@ -3910,10 +3910,10 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
|
|
||||||
aPoint.y -= _bounds.origin.y;
|
aPoint.y -= _bounds.origin.y;
|
||||||
return_value = (int) (aPoint.y / _rowHeight);
|
return_value = (int) (aPoint.y / _rowHeight);
|
||||||
/* This could happen if point lies on the grid line below the last row */
|
/* This could happen if point lies on the grid line or below the last row */
|
||||||
if (return_value == _numberOfRows)
|
if (return_value >= _numberOfRows)
|
||||||
{
|
{
|
||||||
return_value--;
|
return_value = _numberOfRows - 1;
|
||||||
}
|
}
|
||||||
return return_value;
|
return return_value;
|
||||||
}
|
}
|
||||||
|
@ -4299,7 +4299,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
- (void) noteNumberOfRowsChanged
|
- (void) noteNumberOfRowsChanged
|
||||||
{
|
{
|
||||||
_numberOfRows = [_dataSource numberOfRowsInTableView: self];
|
_numberOfRows = [_dataSource numberOfRowsInTableView: self];
|
||||||
|
|
||||||
/* If we are selecting rows, we have to check that we have no
|
/* If we are selecting rows, we have to check that we have no
|
||||||
selected rows below the new end of the table */
|
selected rows below the new end of the table */
|
||||||
if (!_selectingColumns)
|
if (!_selectingColumns)
|
||||||
|
@ -4352,7 +4352,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
_frame.origin.y,
|
_frame.origin.y,
|
||||||
_frame.size.width,
|
_frame.size.width,
|
||||||
(_numberOfRows * _rowHeight) + 1)];
|
(_numberOfRows * _rowHeight) + 1)];
|
||||||
|
|
||||||
/* If we are shorter in height than the enclosing clipview, we
|
/* If we are shorter in height than the enclosing clipview, we
|
||||||
should redraw us now. */
|
should redraw us now. */
|
||||||
if (_super_view != nil)
|
if (_super_view != nil)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue