Fixed bug in getting path when a column had nothing selected in it

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8615 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2001-01-16 12:32:19 +00:00
parent e9791f5e89
commit fda6234a57

View file

@ -630,7 +630,8 @@ static float scrollerWidth; // == [NSScroller scrollerWidth]
{
NSMutableString *s = [_pathSeparator mutableCopy];
unsigned i;
NSString *string;
#if defined NSBTRACE_pathToColumn || defined NSBTRACE_all
fprintf(stderr, "NSBrowser - (NSString *)pathToColumn: %d\n", column);
#endif
@ -641,13 +642,27 @@ static float scrollerWidth; // == [NSScroller scrollerWidth]
if (column > _lastColumnLoaded)
column = _lastColumnLoaded + 1;
for (i = 0;i < column; ++i)
for (i = 0; i < column; ++i)
{
id c = [self selectedCellInColumn: i];
if (i != 0)
[s appendString: _pathSeparator];
[s appendString: [c stringValue]];
{
[s appendString: _pathSeparator];
}
string = [c stringValue];
if (string == nil)
{
/* This should happen only when c == nil, in which case it
doesn't make sense to go with the path */
break;
}
else
{
[s appendString: string];
}
}
/*
* We actually return a mutable string, but that's ok since a mutable
@ -1772,9 +1787,13 @@ static float scrollerWidth; // == [NSScroller scrollerWidth]
}
else
_scrollerRect = NSZeroRect;
if (!NSEqualRects(_scrollerRect, [_horizontalScroller frame]))
[_horizontalScroller setFrame: _scrollerRect];
{
[_horizontalScroller setFrame: _scrollerRect];
}
// Columns
if (_separatesColumns)
_columnSize.width = (int)((_frame.size.width - ((num - 1) * NSBR_COLUMN_SEP))