Revision: 4839
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4839&view=rev
Author:   hofman
Date:     2008-10-21 09:28:59 +0000 (Tue, 21 Oct 2008)

Log Message:
-----------
Copy archived skim notes from notes document

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

Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m     2008-10-20 18:13:30 UTC (rev 4838)
+++ trunk/SKNotesDocument.m     2008-10-21 09:28:59 UTC (rev 4839)
@@ -60,6 +60,7 @@
 #import "SKCFCallbacks.h"
 #import "SKAnnotationTypeImageCell.h"
 #import "SKPrintableView.h"
+#import "SKPDFView.h"
 
 static NSString *SKNotesDocumentWindowFrameAutosaveName = 
@"SKNotesDocumentWindow";
 
@@ -472,12 +473,22 @@
 - (void)outlineView:(NSOutlineView *)ov copyItems:(NSArray *)items  {
     NSPasteboard *pboard = [NSPasteboard generalPasteboard];
     NSMutableArray *types = [NSMutableArray array];
+    NSData *noteData = nil;
     NSMutableAttributedString *attrString = [[items 
valueForKey:SKNPDFAnnotationTypeKey] containsObject:[NSNull null]] ? 
[[[NSMutableAttributedString alloc] init] autorelease] : nil;
     NSMutableString *string = [NSMutableString string];
-    NSEnumerator *itemEnum = [items objectEnumerator];
+    NSEnumerator *itemEnum;
     id item;
     
+    itemEnum = [items objectEnumerator];
     while (item = [itemEnum nextObject]) {
+        if ([item type] == nil || ([[item type] 
isEqualToString:SKNHighlightString] == NO && [[item type] 
isEqualToString:SKNUnderlineString] == NO && [[item type] 
isEqualToString:SKNStrikeOutString] == NO)) {
+            noteData = [NSKeyedArchiver archivedDataWithRootObject:[([item 
type] ? item : [item note]) SkimNoteProperties]];
+            [types addObject:SKSkimNotePboardType];
+            break;
+        }
+    }
+    itemEnum = [items objectEnumerator];
+    while (item = [itemEnum nextObject]) {
         if ([string length])
             [string appendString:@"\n\n"];
         if ([attrString length])
@@ -491,6 +502,8 @@
     
     if ([string length])
         [types addObject:NSStringPboardType];
+    if (noteData)
+        [pboard setData:noteData forType:SKSkimNotePboardType];
     if ([attrString length])
         [types addObject:NSRTFPboardType];
     if ([types count])


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

Reply via email to