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:
wlux 2010-05-30 21:47:04 +00:00
parent 69cd10b709
commit f235cc977a
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,6 +1322,9 @@ static BOOL flip_hack;
float size = [aDecoder decodeFloatForKey: @"NSSize"];
DESTROY(self);
self = RETAIN([NSFont fontWithName: name size: size]);
if (self == nil)
{
if ([aDecoder containsValueForKey: @"NSfFlags"])
{
int flags = [aDecoder decodeIntForKey: @"NSfFlags"];
@ -1339,10 +1342,6 @@ static BOOL flip_hack;
return RETAIN([NSFont titleBarFontOfSize: size]);
}
}
self = RETAIN([NSFont fontWithName: name size: size]);
if (self == nil)
{
self = RETAIN([NSFont systemFontOfSize: size]);
}