Revision: 4918
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4918&view=rev
Author:   hofman
Date:     2008-11-05 13:48:48 +0000 (Wed, 05 Nov 2008)

Log Message:
-----------
use default bounds and TIFF setting for grab comment when not supplied

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

Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m        2008-11-04 15:35:03 UTC (rev 4917)
+++ trunk/PDFPage_SKExtensions.m        2008-11-05 13:48:48 UTC (rev 4918)
@@ -558,18 +558,17 @@
 - (id)handleGrabScriptCommand:(NSScriptCommand *)command {
        NSDictionary *args = [command evaluatedArguments];
     NSData *boundsData = [args objectForKey:@"Bounds"];
-    id asTIFF = [args objectForKey:@"AsTIFF"];
+    id asTIFFNumber = [args objectForKey:@"AsTIFF"];
+    NSRect bounds = [boundsData 
respondsToSelector:@selector(rectValueAsQDRect)] ? [boundsData 
rectValueAsQDRect] : NSZeroRect;
+    BOOL asTIFF = [asTIFFNumber respondsToSelector:@selector(boolValue)] ? 
[asTIFFNumber boolValue] : NO; 
     NSData *data = nil;
     DescType type = 0;
     
-    if ([boundsData isKindOfClass:[NSData class]] == NO || (asTIFF && [asTIFF 
respondsToSelector:@selector(boolValue)] == NO))
-        return nil;
-    
-    if ([asTIFF boolValue]) {
-        data = [self TIFFDataForRect:[boundsData rectValueAsQDRect]];
+    if (asTIFF) {
+        data = [self TIFFDataForRect:bounds];
         type = 'TIFF';
     } else {
-        data = [self PDFDataForRect:[boundsData rectValueAsQDRect]];
+        data = [self PDFDataForRect:bounds];
         type = 'PDF ';
     }
     


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