Switch from float to CGFloat for column origins in table view

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@40255 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2016-12-06 23:44:45 +00:00
parent 6566f7b41d
commit 8d6d271138
4 changed files with 28 additions and 28 deletions

View file

@ -157,7 +157,7 @@ typedef enum _NSTableViewAnimationOptions
* origin of each column). When a column width is changed through
* [NSTableColumn setWidth:], then [NSTableView tile] gets called,
* which updates the cache. */
float *_columnOrigins;
CGFloat *_columnOrigins;
/*
* We keep the superview's width in order to know when to

View file

@ -73,7 +73,7 @@
#define COLOR_WELL_BORDER_WIDTH 7.0
@interface NSTableView (Private)
- (float *)_columnOrigins;
- (CGFloat *)_columnOrigins;
- (void) _willDisplayCell: (NSCell*)cell forTableColumn: (NSTableColumn *)tb row: (int)index;
// TESTPLANT-MAL-2016: Keeping for tableview grouped row support AKA Cocoa...
- (NSCell *) _dataCellForTableColumn: (NSTableColumn *)tb row: (int) rowIndex;
@ -3291,7 +3291,7 @@ typedef enum {
// NSIndexSet *selectedRows = [tableView _selectedRowIndexes];
// NSColor *backgroundColor = [tableView backgroundColor];
id dataSource = [tableView dataSource];
float *columnOrigins = [tableView _columnOrigins];
CGFloat *columnOrigins = [tableView _columnOrigins];
int editedRow = [tableView editedRow];
int editedColumn = [tableView editedColumn];
int startingColumn;
@ -3299,7 +3299,7 @@ typedef enum {
NSRect drawingRect;
NSCell *cell;
int i;
float x_pos;
CGFloat x_pos;
if (dataSource == nil)
{
@ -3345,9 +3345,9 @@ typedef enum {
x_pos = NSMinX (clipRect);
i = 0;
while ((i < numberOfColumns) && (x_pos > columnOrigins[i]))
{
i++;
}
{
i++;
}
startingColumn = (i - 1);
if (startingColumn == -1)
@ -3357,9 +3357,9 @@ typedef enum {
x_pos = NSMaxX (clipRect);
// Nota Bene: we do *not* reset i
while ((i < numberOfColumns) && (x_pos > columnOrigins[i]))
{
i++;
}
{
i++;
}
endingColumn = (i - 1);
if (endingColumn == -1)

View file

@ -56,7 +56,7 @@
@interface NSTableView (GNUstepPrivate)
- (void) _userResizedTableColumn: (int)index
width: (float)width;
- (float *) _columnOrigins;
- (CGFloat *) _columnOrigins;
- (void) _mouseDownInHeaderOfTableColumn: (NSTableColumn *)tc;
- (void) _clickTableColumn: (NSTableColumn *)tc;
@end
@ -487,7 +487,7 @@
maxCoord = NSMaxX(bounds);
}
{
float *_c = [_tableView _columnOrigins];
CGFloat *_c = [_tableView _columnOrigins];
_cO_minus1 = malloc((numberOfColumns + 3) * sizeof(CGFloat));
_cO = _cO_minus1 + 1;
memcpy(_cO, _c, numberOfColumns * sizeof(CGFloat));

View file

@ -2143,11 +2143,11 @@ static void computeNewSelection
if (_numberOfColumns > 1)
{
_columnOrigins = NSZoneRealloc (NSDefaultMallocZone (), _columnOrigins,
(sizeof (float)) * _numberOfColumns);
(sizeof (CGFloat)) * _numberOfColumns);
}
else
{
_columnOrigins = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float));
_columnOrigins = NSZoneMalloc (NSDefaultMallocZone (), sizeof (CGFloat));
}
[self tile];
}
@ -2182,7 +2182,7 @@ static void computeNewSelection
if (_numberOfColumns > 0)
{
_columnOrigins = NSZoneRealloc (NSDefaultMallocZone (), _columnOrigins,
(sizeof (float)) * _numberOfColumns);
(sizeof (CGFloat)) * _numberOfColumns);
}
else
{
@ -4583,9 +4583,9 @@ This method is deprecated, use -columnIndexesInRect:. */
int i = 0;
while ((i < _numberOfColumns) && (aPoint.x >= _columnOrigins[i]))
{
i++;
}
{
i++;
}
return i - 1;
}
}
@ -5141,8 +5141,8 @@ This method is deprecated, use -columnIndexesInRect:. */
- (void) tile
{
float table_width = 0;
float table_height;
CGFloat table_width = 0;
CGFloat table_height;
if (_tilingDisabled == YES)
return;
@ -5150,17 +5150,17 @@ This method is deprecated, use -columnIndexesInRect:. */
if (_numberOfColumns > 0)
{
int i;
float width;
CGFloat width;
_columnOrigins[0] = _bounds.origin.x;
width = [[_tableColumns objectAtIndex: 0] width];
table_width += width;
for (i = 1; i < _numberOfColumns; i++)
{
_columnOrigins[i] = _columnOrigins[i - 1] + width;
width = [[_tableColumns objectAtIndex: i] width];
table_width += width;
}
{
_columnOrigins[i] = _columnOrigins[i - 1] + width;
width = [[_tableColumns objectAtIndex: i] width];
table_width += width;
}
}
/* + 1 for the last grid line */
table_height = (_numberOfRows * _rowHeight) + 1;
@ -6002,7 +6002,7 @@ This method is deprecated, use -columnIndexesInRect:. */
if (_numberOfColumns > 0)
{
_columnOrigins = NSZoneMalloc (NSDefaultMallocZone (),
sizeof(float) * _numberOfColumns);
sizeof(CGFloat) * _numberOfColumns);
}
[self tile]; /* Initialize _columnOrigins */
}
@ -6064,7 +6064,7 @@ This method is deprecated, use -columnIndexesInRect:. */
[[_tableColumns objectAtIndex: index] setWidth: width];
}
- (float *) _columnOrigins
- (CGFloat *) _columnOrigins
{
return _columnOrigins;
}