Revision: 4879
http://skim-app.svn.sourceforge.net/skim-app/?rev=4879&view=rev
Author: hofman
Date: 2008-10-27 15:39:43 +0000 (Mon, 27 Oct 2008)
Log Message:
-----------
Let coercion handler have a shot to coerce a string to a color, as it
apparently knows about some standard color names
Modified Paths:
--------------
trunk/NSColor_SKExtensions.m
Modified: trunk/NSColor_SKExtensions.m
===================================================================
--- trunk/NSColor_SKExtensions.m 2008-10-27 15:16:48 UTC (rev 4878)
+++ trunk/NSColor_SKExtensions.m 2008-10-27 15:39:43 UTC (rev 4879)
@@ -92,7 +92,14 @@
case SKScriptingColorDarkGray: return [NSColor darkGrayColor];
case SKScriptingColorLightGray: return [NSColor
lightGrayColor];
case SKScriptingColorClear: return [NSColor clearColor];
- default: return nil;
+ default:
+ {
+ NSString *string = [descriptor stringValue];
+ if (string) {
+ NSColor *color = [[NSScriptCoercionHandler
sharedCoercionHandler] coerceValue:string toClass:[NSColor class]];
+ return [color isKindOfClass:[NSColor class]] ? color :
nil;
+ }
+ }
}
break;
case 4:
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit