mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 22:47:39 +00:00
Fix encoding/decoding of matrixExplicitlySet.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14466 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
352ae1bc9a
commit
12644d7d71
2 changed files with 27 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2002-09-16 19:28 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/NSFont (+initialize, -initWithCoder:, -encodeWithCoder:):
|
||||
Encode and decode matrixExplicitlySet, and guess its value when
|
||||
loading old encoded objects.
|
||||
|
||||
2002-09-16 19:05 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/NSWindow.m (-close): Retain and release self to make sure
|
||||
|
|
|
@ -165,6 +165,8 @@ setNSFont(NSString* key, NSFont* font)
|
|||
{
|
||||
defaults = RETAIN([NSUserDefaults standardUserDefaults]);
|
||||
}
|
||||
|
||||
[self setVersion: 2];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -771,16 +773,34 @@ setNSFont(NSString* key, NSFont* font)
|
|||
{
|
||||
[aCoder encodeObject: fontName];
|
||||
[aCoder encodeArrayOfObjCType: @encode(float) count: 6 at: matrix];
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &matrixExplicitlySet];
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||
{
|
||||
int version = [aDecoder versionForClassName:
|
||||
@"NSFont"];
|
||||
id name;
|
||||
float fontMatrix[6];
|
||||
|
||||
name = [aDecoder decodeObject];
|
||||
[aDecoder decodeArrayOfObjCType: @encode(float) count: 6 at: fontMatrix];
|
||||
return [self initWithName: name matrix: fontMatrix];
|
||||
self = [self initWithName: name matrix: fontMatrix];
|
||||
|
||||
if (version == 2)
|
||||
{
|
||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &matrixExplicitlySet];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fontMatrix[0] == fontMatrix[3]
|
||||
&& fontMatrix[1]==0.0
|
||||
&& fontMatrix[2]==0.0)
|
||||
{
|
||||
matrixExplicitlySet = NO;
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end /* NSFont */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue