Revision: 5153
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5153&view=rev
Author:   hofman
Date:     2009-01-21 22:34:19 +0000 (Wed, 21 Jan 2009)

Log Message:
-----------
use RTF type for "get text for" command

Modified Paths:
--------------
    trunk/SKTextCommand.m
    trunk/Skim.sdef

Modified: trunk/SKTextCommand.m
===================================================================
--- trunk/SKTextCommand.m       2009-01-21 22:17:29 UTC (rev 5152)
+++ trunk/SKTextCommand.m       2009-01-21 22:34:19 UTC (rev 5153)
@@ -53,10 +53,8 @@
     if ([dP respondsToSelector:@selector(objectsByEvaluatingSpecifier)])
         dPO = [dP objectsByEvaluatingSpecifier];
     
-    NSDictionary *args = [self evaluatedArguments];
-    PDFPage *page = [args objectForKey:@"Page"];
+    PDFPage *page = [[self evaluatedArguments] objectForKey:@"Page"];
     NSAttributedString *attributedString = nil;
-    NSData *data = nil;
     
     if ([dPO isKindOfClass:[SKPDFDocument class]]) {
         attributedString = page ? [page attributedString] : [dPO richText];
@@ -66,15 +64,13 @@
     } else if ([dPO isKindOfClass:[PDFAnnotation class]]) {
         if (page == nil || [page isEqual:[dPO page]])
             attributedString = [dPO textContents];
-    } else if ([dP isKindOfClass:[NSAppleEventDescriptor class]]) {
-        data = [dP data];
+    } else if ([dP isKindOfClass:[NSAttributedString class]]) {
+        attributedString = dP;
     } else {
         attributedString = [[PDFSelection selectionWithSpecifier:dP 
onPage:page] attributedString];
     }
     
-    if (data == nil)
-        data = [attributedString RTFRepresentation];
-    return data ? [SKRichTextFormat richTextSpecifierWithData:data] : nil;
+    return [SKRichTextFormat richTextSpecifierWithData:[attributedString 
RTFRepresentation]];
 }
 
 @end

Modified: trunk/Skim.sdef
===================================================================
--- trunk/Skim.sdef     2009-01-21 22:17:29 UTC (rev 5152)
+++ trunk/Skim.sdef     2009-01-21 22:34:19 UTC (rev 5153)
@@ -1330,7 +1330,7 @@
                 description="The document, page, note, selection, or raw RTF 
data.">
                 <type type="specifier"/>
                 <type type="specifier" list="yes"/>
-                <type type="any"/>
+                <type type="RTF"/>
             </direct-parameter>
             <parameter name="on" type="page" code="on  " optional="yes"
                 description="The page on which to get the text.">


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:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to