Revision: 7645
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7645&view=rev
Author:   hofman
Date:     2012-02-14 10:54:14 +0000 (Tue, 14 Feb 2012)
Log Message:
-----------
simplify sort descriptor initializers

Modified Paths:
--------------
    trunk/NSArray_SKExtensions.m
    trunk/SKMainWindowController_UI.m
    trunk/SKNotesDocument.m

Modified: trunk/NSArray_SKExtensions.m
===================================================================
--- trunk/NSArray_SKExtensions.m        2012-02-14 10:44:57 UTC (rev 7644)
+++ trunk/NSArray_SKExtensions.m        2012-02-14 10:54:14 UTC (rev 7645)
@@ -51,7 +51,7 @@
 }
 
 - (NSArray *)arraySortedByPageIndex {
-    return [self sortedArrayUsingDescriptors:[NSArray 
arrayWithObject:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationPageIndexKey ascending:YES 
selector:@selector(compare:)] autorelease]]];
+    return [self sortedArrayUsingDescriptors:[NSArray 
arrayWithObject:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationPageIndexKey ascending:YES] autorelease]]];
 }
 
 - (NSArray *)arraySortedByBounds {
@@ -59,7 +59,7 @@
 }
 
 - (NSArray *)arraySortedByPageIndexAndBounds {
-    return [self sortedArrayUsingDescriptors:[NSArray 
arrayWithObjects:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationPageIndexKey ascending:YES 
selector:@selector(compare:)] autorelease], [[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationBoundsKey ascending:YES 
selector:@selector(boundsCompare:)] autorelease], nil]];
+    return [self sortedArrayUsingDescriptors:[NSArray 
arrayWithObjects:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationPageIndexKey ascending:YES] autorelease], 
[[[NSSortDescriptor alloc] initWithKey:SKNPDFAnnotationBoundsKey ascending:YES 
selector:@selector(boundsCompare:)] autorelease], nil]];
 }
 
 - (NSArray *)arraySortedByType {
@@ -75,7 +75,7 @@
 }
 
 - (NSArray *)arraySortedByTypeAndPageIndex {
-    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]];
+    return [self sortedArrayUsingDescriptors:[NSArray 
arrayWithObjects:[[[NSSortDescriptor alloc] initWithKey:SKNPDFAnnotationTypeKey 
ascending:YES selector:@selector(noteTypeCompare:)] autorelease], 
[[[NSSortDescriptor alloc] initWithKey:SKNPDFAnnotationPageIndexKey 
ascending:YES] autorelease], nil]];
 }
 
 - (NSArray *)arraySortedByColor {
@@ -83,7 +83,7 @@
 }
 
 - (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]];
+    return [self sortedArrayUsingDescriptors:[NSArray 
arrayWithObjects:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationColorKey ascending:YES 
selector:@selector(colorCompare:)] autorelease], [[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationPageIndexKey ascending:YES] autorelease], nil]];
 }
 
 @end

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2012-02-14 10:44:57 UTC (rev 7644)
+++ trunk/SKMainWindowController_UI.m   2012-02-14 10:54:14 UTC (rev 7645)
@@ -716,7 +716,7 @@
             } else if ([tcID isEqualToString:AUTHOR_COLUMNID]) {
                 [sds insertObject:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationUserNameKey ascending:YES 
selector:@selector(localizedCaseInsensitiveNumericCompare:)] autorelease] 
atIndex:0];
             } else if ([tcID isEqualToString:DATE_COLUMNID]) {
-                [sds insertObject:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationModificationDateKey ascending:YES 
selector:@selector(compare:)] autorelease] atIndex:0];
+                [sds insertObject:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationModificationDateKey ascending:YES] autorelease] 
atIndex:0];
             }
             sortDescriptors = sds;
             if (oldTableColumn)

Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m     2012-02-14 10:44:57 UTC (rev 7644)
+++ trunk/SKNotesDocument.m     2012-02-14 10:54:14 UTC (rev 7645)
@@ -659,7 +659,7 @@
         } else if ([tcID isEqualToString:AUTHOR_COLUMNID]) {
             [sds insertObject:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationUserNameKey ascending:YES 
selector:@selector(localizedCaseInsensitiveNumericCompare:)] autorelease] 
atIndex:0];
         } else if ([tcID isEqualToString:DATE_COLUMNID]) {
-            [sds insertObject:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationModificationDateKey ascending:YES 
selector:@selector(compare:)] autorelease] atIndex:0];
+            [sds insertObject:[[[NSSortDescriptor alloc] 
initWithKey:SKNPDFAnnotationModificationDateKey ascending:YES] autorelease] 
atIndex:0];
         } else if ([tcID isEqualToString:PAGE_COLUMNID]) {
             if (oldTableColumn == nil)
                 ascending = NO;

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


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to