colCount and _firstVisible Column must always be decoded

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11447 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Laurent Julliard 2001-11-21 13:28:28 +00:00
parent 0ff9254ac1
commit 03bfda7aa2
2 changed files with 8 additions and 5 deletions

View file

@ -1,3 +1,7 @@
2001-11-21 Laurent Julliard <laurent@julliard-online.org>
* Source/NSBrowser.m (-initWithCoder:): colCount and _firstVisible Column must always be decoded. Bug fixed (thanks to Adam Fedor)
2001-11-20 Laurent Julliard <laurent@julliard-online.org>
* Source/NSComboBoxCell.m (-setNumberOfVisibleItems): max number of items tested on wrong variable. Corrected

View file

@ -2625,6 +2625,7 @@ static double rint(double a)
- (id) initWithCoder: (NSCoder*)aDecoder
{
int colCount;
[super initWithCoder: aDecoder];
@ -2684,13 +2685,12 @@ static double rint(double a)
[self _createColumn];
// ..and rebuild any existing browser columns
[aDecoder decodeValueOfObjCType: @encode(int) at: &colCount];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_firstVisibleColumn];
if (_browserDelegate != nil)
{
int i;
int colCount;
[aDecoder decodeValueOfObjCType: @encode(int) at: &colCount];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_firstVisibleColumn];
[self loadColumnZero];
for (i=1;i<colCount; i++)
@ -2698,7 +2698,6 @@ static double rint(double a)
[self addColumn];
}
[self scrollColumnsRightBy: _firstVisibleColumn];
}
// Make sure it displays ok even if there isn't any column