mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 22:31:56 +00:00
Merging changes from the trunk to the branch for testplant for NSImage changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@35317 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
09227d4ba2
commit
eee9416e6b
1 changed files with 27 additions and 1 deletions
|
@ -1652,7 +1652,33 @@ static NSSize GSResolutionOfImageRep(NSImageRep *rep)
|
||||||
// element which is an array with a first element 0 and than the image rep.
|
// element which is an array with a first element 0 and than the image rep.
|
||||||
reps = [coder decodeObjectForKey: @"NSReps"];
|
reps = [coder decodeObjectForKey: @"NSReps"];
|
||||||
reps = [reps objectAtIndex: 0];
|
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 we are unable to resolved the URL, try to get it from the
|
||||||
|
// resources folder.
|
||||||
|
if(rep == nil)
|
||||||
|
{
|
||||||
|
NSString *fileName = [[rep absoluteString] lastPathComponent];
|
||||||
|
NSString *path = [[NSBundle mainBundle] pathForImageResource:fileName];
|
||||||
|
rep = [NSImageRep imageRepWithContentsOfFile:path];
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the representation was found, add it...
|
||||||
|
if(rep != nil)
|
||||||
|
{
|
||||||
|
[self addRepresentation: rep];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ([coder containsValueForKey: @"NSSize"])
|
if ([coder containsValueForKey: @"NSSize"])
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue