mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Replaced inefficient call to [matrix sizeToFit] with much more efficient
determination of the browsercell height git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11348 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
912536c1de
commit
b71c370c78
1 changed files with 17 additions and 11 deletions
|
@ -2896,21 +2896,17 @@ static double rint(double a)
|
|||
if (_passiveDelegate || [_browserDelegate respondsToSelector:
|
||||
@selector(browser:willDisplayCell:atRow:column:)])
|
||||
{
|
||||
SEL sel1 =
|
||||
@selector(browser:willDisplayCell:atRow:column:);
|
||||
IMP imp1 =
|
||||
[_browserDelegate methodForSelector: sel1];
|
||||
SEL sel2 =
|
||||
@selector(cellAtRow:column:);
|
||||
IMP imp2 =
|
||||
[matrix methodForSelector: sel2];
|
||||
SEL sel1 = @selector(browser:willDisplayCell:atRow:column:);
|
||||
IMP imp1 = [_browserDelegate methodForSelector: sel1];
|
||||
SEL sel2 = @selector(cellAtRow:column:);
|
||||
IMP imp2 = [matrix methodForSelector: sel2];
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
aCell = (*imp2)(matrix, sel2, i, 0);
|
||||
if (![aCell isLoaded])
|
||||
{
|
||||
(*imp1)(_browserDelegate, sel1,
|
||||
self, aCell, i, column);
|
||||
(*imp1)(_browserDelegate, sel1, self, aCell, i,
|
||||
column);
|
||||
[aCell setLoaded: YES];
|
||||
}
|
||||
}
|
||||
|
@ -2961,7 +2957,17 @@ static double rint(double a)
|
|||
}
|
||||
}
|
||||
|
||||
[matrix sizeToFit];
|
||||
/* Determine the height of a cell in the matrix, and set that as the
|
||||
cellSize of the matrix. */
|
||||
{
|
||||
NSBrowserCell *b = [matrix cellAtRow: 0 column: 0];
|
||||
|
||||
if (b != nil)
|
||||
{
|
||||
[matrix setCellSize: [b cellSize]];
|
||||
}
|
||||
}
|
||||
|
||||
[sc setNeedsDisplay: YES];
|
||||
[bc setIsLoaded: YES];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue