mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 12:00:52 +00:00
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:
parent
36c6a1a4bb
commit
6b7116a19a
2 changed files with 22 additions and 18 deletions
|
@ -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:,
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue