Fixed keyed decoding of NSFont to fall back to a standard font only if

the named font was not found.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30499 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2010-05-30 21:47:04 +00:00
parent 36c6a1a4bb
commit 6b7116a19a
2 changed files with 22 additions and 18 deletions

View file

@ -1,3 +1,8 @@
2010-05-30 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSFont.m (-initWithCoder:): Fixed keyed decoding to fall
back to a standard font only if the named font was not found.
2010-05-30 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSTextView.m (NSTextViewUndoObject, -performUndo:,

View file

@ -1322,27 +1322,26 @@ static BOOL flip_hack;
float size = [aDecoder decodeFloatForKey: @"NSSize"];
DESTROY(self);
if ([aDecoder containsValueForKey: @"NSfFlags"])
{
int flags = [aDecoder decodeIntForKey: @"NSfFlags"];
// FIXME
if (flags == 16)
{
return RETAIN([NSFont controlContentFontOfSize: size]);
}
else if (flags == 20)
{
return RETAIN([NSFont labelFontOfSize: size]);
}
else if (flags == 22)
{
return RETAIN([NSFont titleBarFontOfSize: size]);
}
}
self = RETAIN([NSFont fontWithName: name size: size]);
if (self == nil)
{
if ([aDecoder containsValueForKey: @"NSfFlags"])
{
int flags = [aDecoder decodeIntForKey: @"NSfFlags"];
// FIXME
if (flags == 16)
{
return RETAIN([NSFont controlContentFontOfSize: size]);
}
else if (flags == 20)
{
return RETAIN([NSFont labelFontOfSize: size]);
}
else if (flags == 22)
{
return RETAIN([NSFont titleBarFontOfSize: size]);
}
}
self = RETAIN([NSFont systemFontOfSize: size]);
}