* Source/NSImage.m: -[NSImage initWithCoder:]

Some XIB files have image representations encoded
	via NSURL.  When this happens it causes the XIB not to be loaded at
	all since the image rep fails to load and causes the xib loading
	process to fail.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35310 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2012-07-20 18:25:55 +00:00
parent 5a2b7bc268
commit 1a81de9b5d
2 changed files with 24 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2012-07-20 14:06-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Source/NSImage.m: -[NSImage initWithCoder:]
Some XIB files have image representations encoded
via NSURL. When this happens it causes the XIB not to be loaded at
all since the image rep fails to load and causes the xib loading
process to fail.
2012-07-05 Quentin Mathe <quentin.mathe@gmail.com>
* Headers/AppKit/NSNibDeclarations.h: Fixed recent Clang warnings when

View file

@ -1652,7 +1652,22 @@ static NSSize GSResolutionOfImageRep(NSImageRep *rep)
// element which is an array with a first element 0 and than the image rep.
reps = [coder decodeObjectForKey: @"NSReps"];
reps = [reps objectAtIndex: 0];
[self addRepresentation: [reps objectAtIndex: 1]];
id rep = [reps objectAtIndex: 1];
if([rep isKindOfClass:[NSImageRep class]])
{
[self addRepresentation: rep];
}
else
{
if([rep isKindOfClass:[NSURL class]])
{
rep = [NSImageRep imageRepWithContentsOfURL:rep];
if(rep != nil)
{
[self addRepresentation: rep];
}
}
}
}
if ([coder containsValueForKey: @"NSSize"])
{