Patch for possible string size caching problem for same strings

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@37710 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2014-02-25 18:49:27 +00:00
parent 706eec3f24
commit c96089be04

View file

@ -176,16 +176,19 @@ static GSAutocompleteWindow *gsWindow = nil;
while ((word = [enumerator nextObject]))
{
if ([word length] > widest)
{
widest = [word length];
widestWord = word;
}
{
widest = [word length];
widestWord = word;
}
}
// String size caching could cache one of our strings with the wrong sizing
widestWord = [NSString stringWithFormat:@"%@#",widestWord];
// Width
cell = [[_tableView tableColumnWithIdentifier: @"content"] dataCell];
windowWidth = 1.1*[cell _sizeText: widestWord].width
+ [NSScroller scrollerWidth] + 2*bsize.width;
windowWidth = ([cell _sizeText: widestWord].width + [NSScroller scrollerWidth] + 2*bsize.width);
// windowWidth *= 1.1;
//Height
windowHeight = 2*bsize.height + [_tableView rowHeight]*num