mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 00:20:49 +00:00
* 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:
parent
5a2b7bc268
commit
1a81de9b5d
2 changed files with 24 additions and 1 deletions
|
@ -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"])
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue