Revision: 5936
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5936&view=rev
Author:   hofman
Date:     2009-10-22 17:35:50 +0000 (Thu, 22 Oct 2009)

Log Message:
-----------
Allow creating a note without type when it has a contentsValue, make a text 
note from the text

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

Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m        2009-10-22 17:31:55 UTC (rev 5935)
+++ trunk/PDFPage_SKExtensions.m        2009-10-22 17:35:50 UTC (rev 5936)
@@ -470,10 +470,7 @@
         FourCharCode type = [[properties 
objectForKey:SKPDFAnnotationScriptingNoteTypeKey] unsignedLongValue];
         [props removeObjectForKey:SKPDFAnnotationScriptingNoteTypeKey];
         
-        if (type == 0) {
-            [[NSScriptCommand currentCommand] 
setScriptErrorNumber:NSRequiredArgumentsMissingScriptError]; 
-            [[NSScriptCommand currentCommand] 
setScriptErrorString:NSLocalizedString(@"New notes need a type.", @"Error 
description")];
-        } else if (type == SKScriptingHighlightNote || type == 
SKScriptingStrikeOutNote || type == SKScriptingUnderlineNote) {
+        if (type == SKScriptingHighlightNote || type == 
SKScriptingStrikeOutNote || type == SKScriptingUnderlineNote) {
             id selSpec = [properties 
objectForKey:SKPDFAnnotationSelectionSpecifierKey];
             PDFSelection *selection;
             NSInteger markupType = 0;
@@ -535,7 +532,13 @@
             annotation = [[PDFAnnotationSquare alloc] 
initSkimNoteWithBounds:bounds];
         } else if (type == SKScriptingLineNote) {
             annotation = [[PDFAnnotationLine alloc] 
initSkimNoteWithBounds:bounds];
+        } else if (contentsValue) {
+            annotation = [[PDFAnnotationFreeText alloc] 
initSkimNoteWithBounds:bounds];
+        } else {
+            [[NSScriptCommand currentCommand] 
setScriptErrorNumber:NSRequiredArgumentsMissingScriptError]; 
+            [[NSScriptCommand currentCommand] 
setScriptErrorString:NSLocalizedString(@"New notes need a type.", @"Error 
description")];
         }
+
         if (annotation) {
             if (contentsValue) {
                 NSString *contentsKey = [[NSScriptClassDescription 
classDescriptionForClass:class] defaultSubcontainerAttributeKey];


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

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) 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/devconference
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to