Added a small hack to work around and Ibeam cursor image inserted in XIB files by Xcode, which would not be found in the project and therefore was substituted with the default arrow cursor.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@37189 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Frank Le Grand 2013-10-03 20:20:25 +00:00
parent 4d5c80b58c
commit 44c6dfb650
3 changed files with 47 additions and 2 deletions

View file

@ -1719,6 +1719,24 @@ static NSSize GSResolutionOfImageRep(NSImageRep *rep)
NSString *fileName = [[tmp absoluteString] lastPathComponent];
NSString *path = [[NSBundle mainBundle] pathForImageResource: fileName];
rep = [NSImageRep imageRepWithContentsOfFile: path];
// This hack is a workaround on the issue where Xcode is including its cursor image
// on NSTextView's scroll view: We set the name of the image so we can catch it
// in the NSCursor's initWithCoder:
if ([[tmp absoluteString] isEqualToString:@"file://localhost/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff"])
{
[nameDict removeObjectForKey:[tmp absoluteString]];
[self setName:[tmp absoluteString]];
}
else if ([[tmp absoluteString] rangeOfString:@"/Xcode.app/"].length > 0
|| [[tmp absoluteString] rangeOfString:@"/DVTKit.framework/"].length > 0)
{
NSLog (@"WARNING: Decoding image with absolute path %@."
@" Xcode may have inserted this in your XIB and the"
@" image may not be available in the app's resources"
, [tmp absoluteString]);
}
}
// If the representation was found, add it...