Revision: 5848
http://skim-app.svn.sourceforge.net/skim-app/?rev=5848&view=rev
Author: hofman
Date: 2009-10-05 12:51:03 +0000 (Mon, 05 Oct 2009)
Log Message:
-----------
sort color column
Modified Paths:
--------------
trunk/SKNotesDocument.m
Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m 2009-10-05 12:39:21 UTC (rev 5847)
+++ trunk/SKNotesDocument.m 2009-10-05 12:51:03 UTC (rev 5848)
@@ -62,6 +62,7 @@
#import "SKPDFView.h"
#import "NSPointerFunctions_SKExtensions.h"
#import "SKFloatMapTable.h"
+#import "NSColor_SKExtensions.h"
#define SKNotesDocumentWindowFrameAutosaveName @"SKNotesDocumentWindow"
@@ -73,9 +74,10 @@
#define NOTES_KEY @"notes"
-#define NOTE_COLUMNID @"note"
-#define TYPE_COLUMNID @"type"
-#define PAGE_COLUMNID @"page"
+#define NOTE_COLUMNID @"note"
+#define TYPE_COLUMNID @"type"
+#define COLOR_COLUMNID @"color"
+#define PAGE_COLUMNID @"page"
@implementation SKNotesDocument
@@ -441,6 +443,8 @@
return [item type] ? (id)[item string] : (id)[item text];
} else if([tcID isEqualToString:TYPE_COLUMNID]) {
return [NSDictionary dictionaryWithObjectsAndKeys:[item type],
SKAnnotationTypeImageCellTypeKey, nil];
+ } else if([tcID isEqualToString:COLOR_COLUMNID]) {
+ return [item type] ? [item color] : nil;
} else if ([tcID isEqualToString:PAGE_COLUMNID]) {
return [item type] ? [NSString stringWithFormat:@"%lu", (unsigned
long)([item pageIndex] + 1)] : nil;
}
@@ -461,6 +465,8 @@
NSMutableArray *sds = [NSMutableArray
arrayWithObjects:pageIndexSortDescriptor, boundsSortDescriptor, nil];
if ([tcID isEqualToString:TYPE_COLUMNID]) {
[sds insertObject:[[[NSSortDescriptor alloc]
initWithKey:SKNPDFAnnotationTypeKey ascending:YES
selector:@selector(noteTypeCompare:)] autorelease] atIndex:0];
+ } else if ([tcID isEqualToString:COLOR_COLUMNID]) {
+ [sds insertObject:[[[NSSortDescriptor alloc]
initWithKey:SKNPDFAnnotationColorKey ascending:YES
selector:@selector(colorCompare:)] autorelease] atIndex:0];
} else if ([tcID isEqualToString:NOTE_COLUMNID]) {
[sds insertObject:[[[NSSortDescriptor alloc]
initWithKey:SKNPDFAnnotationStringKey ascending:YES
selector:@selector(localizedCaseInsensitiveNumericCompare:)] autorelease]
atIndex:0];
} else if ([tcID isEqualToString:PAGE_COLUMNID]) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® 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-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit