mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 02:00:48 +00:00
* Source/NSScrollView.m (-encodeWithCoder:, -initWithCoder:):
Correct keyed encoding and decoding of flags. NIB files created from GNUstep will need to be recreated. Should fix bug #34498. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34008 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
43c4a9d0f0
commit
2653212909
2 changed files with 18 additions and 25 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2011-10-11 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSScrollView.m (-encodeWithCoder:, -initWithCoder:):
|
||||||
|
Correct keyed encoding and decoding of flags. NIB files created
|
||||||
|
from GNUstep will need to be recreated.
|
||||||
|
Should fix bug #34498.
|
||||||
|
|
||||||
2011-10-11 Fred Kiefer <FredKiefer@gmx.de>
|
2011-10-11 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/NSColor.m: Add alpha handling to keyed-coding/decoding.
|
* Source/NSColor.m: Add alpha handling to keyed-coding/decoding.
|
||||||
|
|
|
@ -1454,7 +1454,6 @@ static float scrollerWidth;
|
||||||
if ([aCoder allowsKeyedCoding])
|
if ([aCoder allowsKeyedCoding])
|
||||||
{
|
{
|
||||||
unsigned long flags = 0;
|
unsigned long flags = 0;
|
||||||
GSScrollViewFlags scrollViewFlags;
|
|
||||||
|
|
||||||
[aCoder encodeObject: _horizScroller forKey: @"NSHScroller"];
|
[aCoder encodeObject: _horizScroller forKey: @"NSHScroller"];
|
||||||
[aCoder encodeObject: _vertScroller forKey: @"NSVScroller"];
|
[aCoder encodeObject: _vertScroller forKey: @"NSVScroller"];
|
||||||
|
@ -1466,12 +1465,13 @@ static float scrollerWidth;
|
||||||
[aCoder encodeObject: _headerClipView forKey: @"NSHeaderClipView"];
|
[aCoder encodeObject: _headerClipView forKey: @"NSHeaderClipView"];
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollViewFlags.hasVScroller = _hasVertScroller;
|
flags = _borderType;
|
||||||
scrollViewFlags.hasHScroller = _hasHorizScroller;
|
if (_hasVertScroller)
|
||||||
scrollViewFlags.border = _borderType;
|
flags |= 16;
|
||||||
scrollViewFlags.__unused4 = 0;
|
if (_hasHorizScroller)
|
||||||
scrollViewFlags.__unused1 = 0;
|
flags |= 32;
|
||||||
memcpy((void *)&flags, (void *)&scrollViewFlags,sizeof(unsigned long));
|
if (_autohidesScrollers)
|
||||||
|
flags |= 512;
|
||||||
|
|
||||||
[aCoder encodeInt: flags forKey: @"NSsFlags"];
|
[aCoder encodeInt: flags forKey: @"NSsFlags"];
|
||||||
}
|
}
|
||||||
|
@ -1540,25 +1540,11 @@ static float scrollerWidth;
|
||||||
if ([aDecoder containsValueForKey: @"NSsFlags"])
|
if ([aDecoder containsValueForKey: @"NSsFlags"])
|
||||||
{
|
{
|
||||||
int flags = [aDecoder decodeInt32ForKey: @"NSsFlags"];
|
int flags = [aDecoder decodeInt32ForKey: @"NSsFlags"];
|
||||||
GSScrollViewFlags scrollViewFlags;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Do a memory copy here since the compiler errors out on casts from
|
|
||||||
// scalar (int/float/long) types to structs.
|
|
||||||
//
|
|
||||||
memcpy((void *)&scrollViewFlags,(void *)&flags,sizeof(struct _scrollViewFlags));
|
|
||||||
|
|
||||||
_hasVertScroller = scrollViewFlags.hasVScroller;
|
_borderType = flags & 3;
|
||||||
_hasHorizScroller = scrollViewFlags.hasHScroller;
|
_hasVertScroller = (flags & 16) == 16;
|
||||||
// TODO: Enable once we encode the next values in
|
_hasHorizScroller = (flags & 32) == 32;
|
||||||
// -encodeWithCoder:, but not before otherwise we read random memory.
|
_autohidesScrollers = (flags & 512) == 512;
|
||||||
//_autohidesScrollers = scrollViewFlags.autohidesScrollers;
|
|
||||||
//_scrollsDynamically = (!scrollViewFlags.nonDynamic);
|
|
||||||
//_rulersVisible = scrollViewFlags.showRulers;
|
|
||||||
//_hasHorizRuler = scrollViewFlags.hasHRuler;
|
|
||||||
//_hasVertRuler = scrollViewFlags.hasVRuler;
|
|
||||||
// [self setDrawsBackground: (!scrollViewFlags.doesNotDrawBack)];
|
|
||||||
_borderType = scrollViewFlags.border;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: This should only happen when we load a Mac NIB file.
|
/* FIXME: This should only happen when we load a Mac NIB file.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue