mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
[NSBrowser -_performLoadOfColumn:] : improved performance when loading
previously unloaded column with a passive delegate git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10732 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
08c97488f8
commit
ab5209f426
1 changed files with 32 additions and 5 deletions
|
@ -437,7 +437,9 @@ static double rint(double a)
|
|||
// -------------------
|
||||
// Loads if necessary and returns the NSCell at row in column.
|
||||
//
|
||||
|
||||
// if you change this code, you may want to look at the
|
||||
// _loadColumn method in which the following code is integrated
|
||||
// (for speed)
|
||||
- (id)loadedCellAtRow: (int)row
|
||||
column: (int)column
|
||||
{
|
||||
|
@ -2879,10 +2881,35 @@ static double rint(double a)
|
|||
[sc setDocumentView: matrix];
|
||||
|
||||
// Now loop through the cells and load each one
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
[self loadedCellAtRow: i column: column];
|
||||
}
|
||||
{
|
||||
NSBrowserColumn *bc;
|
||||
id matrix;
|
||||
id aCell;
|
||||
bc = [_browserColumns objectAtIndex: column];
|
||||
matrix = [bc columnMatrix];
|
||||
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];
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
aCell = (*imp2)(matrix, sel2, i, 0);
|
||||
if (![aCell isLoaded])
|
||||
{
|
||||
(*imp1)(_browserDelegate, sel1,
|
||||
self, aCell, i, column);
|
||||
[aCell setLoaded: YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue