Revision: 3921
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3921&view=rev
Author:   hofman
Date:     2008-05-26 11:12:29 -0700 (Mon, 26 May 2008)

Log Message:
-----------
Don't use private method to get accessibilityValue for color. Rather use 
NSColorWell's implementation.

Modified Paths:
--------------
    trunk/NSColor_SKExtensions.h
    trunk/NSColor_SKExtensions.m
    trunk/SKColorSwatch.m

Modified: trunk/NSColor_SKExtensions.h
===================================================================
--- trunk/NSColor_SKExtensions.h        2008-05-26 18:06:55 UTC (rev 3920)
+++ trunk/NSColor_SKExtensions.h        2008-05-26 18:12:29 UTC (rev 3921)
@@ -77,4 +77,6 @@
 + (id)scriptingRgbaColorWithDescriptor:(NSAppleEventDescriptor *)descriptor;
 - (id)scriptingRgbaColorDescriptor;
 
+- (NSString *)accessibilityValue;
+
 @end

Modified: trunk/NSColor_SKExtensions.m
===================================================================
--- trunk/NSColor_SKExtensions.m        2008-05-26 18:06:55 UTC (rev 3920)
+++ trunk/NSColor_SKExtensions.m        2008-05-26 18:12:29 UTC (rev 3921)
@@ -126,4 +126,12 @@
     return descriptor;
 }
 
+- (NSString *)accessibilityValue {
+    static NSColorWell *colorWell = nil;
+    if (colorWell == nil)
+        colorWell = [[NSColorWell alloc] init];
+    [colorWell setColor:self];
+    return [colorWell 
accessibilityAttributeValue:NSAccessibilityValueAttribute];
+}
+
 @end

Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m       2008-05-26 18:06:55 UTC (rev 3920)
+++ trunk/SKColorSwatch.m       2008-05-26 18:12:29 UTC (rev 3921)
@@ -38,6 +38,7 @@
 
 #import "SKColorSwatch.h"
 #import "SKUtilities.h"
+#import "NSColor_SKExtensions.h"
 #import <Carbon/Carbon.h>
 
 NSString *SKColorSwatchColorsChangedNotification = 
@"SKColorSwatchColorsChangedNotification";
@@ -627,12 +628,6 @@
 
 #pragma mark -
 
[EMAIL PROTECTED] NSColor (SKPrivateDeclarations)
-- (id)_accessibilityValue;
[EMAIL PROTECTED]
-
-#pragma mark -
-
 @implementation SKAccessibilityColorSwatchElement
 
 - (id)initWithIndex:(int)anIndex colorSwatch:(SKColorSwatch *)aColorSwatch {
@@ -689,8 +684,7 @@
     } else if ([attribute 
isEqualToString:NSAccessibilityRoleDescriptionAttribute]) {
         return NSAccessibilityRoleDescriptionForUIElement(self);
     } else if ([attribute isEqualToString:NSAccessibilityValueAttribute]) {
-        NSColor *color = [[colorSwatch colors] objectAtIndex:index];
-        return [color respondsToSelector:@selector(_accessibilityValue)] ? 
[color _accessibilityValue] : color;
+        return [[[colorSwatch colors] objectAtIndex:index] accessibilityValue];
     } else if ([attribute isEqualToString:NSAccessibilityParentAttribute]) {
         return NSAccessibilityUnignoredAncestor(colorSwatch);
     } else if ([attribute isEqualToString:NSAccessibilityWindowAttribute]) {


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to