Revision: 5847
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5847&view=rev
Author:   hofman
Date:     2009-10-05 12:39:21 +0000 (Mon, 05 Oct 2009)

Log Message:
-----------
add some sorting methods for color to be used by templates

Modified Paths:
--------------
    trunk/NSArray_SKExtensions.h
    trunk/NSArray_SKExtensions.m

Modified: trunk/NSArray_SKExtensions.h
===================================================================
--- trunk/NSArray_SKExtensions.h        2009-10-05 12:33:49 UTC (rev 5846)
+++ trunk/NSArray_SKExtensions.h        2009-10-05 12:39:21 UTC (rev 5847)
@@ -50,5 +50,7 @@
 - (NSArray *)arraySortedByContents;
 - (NSArray *)arraySortedByTypeAndContents;
 - (NSArray *)arraySortedByTypeAndPageIndex;
+- (NSArray *)arraySortedByColor;
+- (NSArray *)arraySortedByColorAndPageIndex;
 
 @end

Modified: trunk/NSArray_SKExtensions.m
===================================================================
--- trunk/NSArray_SKExtensions.m        2009-10-05 12:33:49 UTC (rev 5846)
+++ trunk/NSArray_SKExtensions.m        2009-10-05 12:39:21 UTC (rev 5847)
@@ -39,6 +39,7 @@
 #import "NSArray_SKExtensions.h"
 #import "NSValue_SKExtensions.h"
 #import "NSString_SKExtensions.h"
+#import "NSColor_SKExtensions.h"
 #import <SkimNotes/SkimNotes.h>
 
 @implementation NSArray (SKExtensions)
@@ -77,4 +78,12 @@
     return [self sortedArrayUsingDescriptors:[NSArray 
arrayWithObjects:[[[NSSortDescriptor alloc] initWithKey:SKNPDFAnnotationTypeKey 
ascending:YES selector:@selector(noteTypeCompare:)] autorelease], 
[[[NSSortDescriptor alloc] initWithKey:SKNPDFAnnotationPageIndexKey 
ascending:YES selector:@selector(compare:)] autorelease], nil]];
 }
 
+- (NSArray *)arraySortedByColor {
+    return [self sortedArrayUsingDescriptors:[NSArray 
arrayWithObject:[[[NSSortDescriptor alloc] initWithKey:SKNPDFAnnotationColorKey 
ascending:YES selector:@selector(colorCompare:)] autorelease]]];
+}
+
+- (NSArray *)arraySortedByColorAndPageIndex {
+    return [self sortedArrayUsingDescriptors:[NSArray 
arrayWithObjects:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationColorKey ascending:YES 
selector:@selector(colorCompare:)] autorelease], [[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationPageIndexKey ascending:YES 
selector:@selector(compare:)] autorelease], nil]];
+}
+
 @end


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to