Fix NSBrowser so that branch cells are really deselected when multiple

selection is enabled and allowsBranchSelection is set to NO. Also
replace the workaround for bug #18881 by a better fix.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29128 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2009-12-15 23:21:16 +00:00
parent 103671a71e
commit 66d5ee1935
2 changed files with 18 additions and 9 deletions

View file

@ -1,3 +1,10 @@
2009-12-16 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSBrowser.m (-doClick:): Fix NSBrowser so that branch
cells are really deselected when multiple selection is enabled and
allowsBranchSelection is set to NO. Also replace the workaround
for bug #18881 by a better fix.
2009-12-15 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSSavePanel.m (-ok:): Avoid the bogus warning that was

View file

@ -533,7 +533,7 @@ static NSTextFieldCell *titleCell;
* implements it). If this call to the delegate returns NO then
* the attempt to set the path fails.<br />
* If the delegate does not implement the method, the browser attempts
* to locate and select the cell itsself, and the method fails if it
* to locate and select the cell itself, and the method fails if it
* is unable to locate the cell by matching its [NSCell-stringValue] with
* the component of the path.
* </p>
@ -2130,19 +2130,21 @@ static NSTextFieldCell *titleCell;
selectedCellsCount = [selectedCells count];
/* FIXME why were we reselecting already selected cells?
* this caused bug #18881 because -selectCell: will scroll the row to visible.
*/
#if 0
// Select cells that should be selected
if (selectedCellsCount > 0)
/* If some branch cells were selected but branch selection is not allowed
reset the selection and select only the leaf cells. It is a pity that
we cannot deselect cells individually. */
if (selectedCellsCount != aCount)
{
BOOL autoscroll = [sender isAutoscroll];
/* Note: Temporarily disable autoscrolling to prevent bug #18881 */
[sender setAutoscroll: NO];
[sender deselectAllCells];
enumerator = [selectedCells objectEnumerator];
while ((cell = [enumerator nextObject]))
[sender selectCell: cell];
[sender setAutoscroll: autoscroll];
}
#endif
[self setLastColumn: column];
// Single selection