Revision: 5687
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5687&view=rev
Author:   hofman
Date:     2009-09-05 19:53:52 +0000 (Sat, 05 Sep 2009)

Log Message:
-----------
add some security checks to workaround in case Aple decides to change it's ivar 
names

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

Modified: trunk/PDFBorder_SKExtensions.m
===================================================================
--- trunk/PDFBorder_SKExtensions.m      2009-09-05 19:40:40 UTC (rev 5686)
+++ trunk/PDFBorder_SKExtensions.m      2009-09-05 19:53:52 UTC (rev 5687)
@@ -70,13 +70,18 @@
 static id (*original_dashPattern)(id, SEL) = NULL;
 
 - (NSArray *)replacement_dashPattern {
-    id vars = [self valueForKey:@"pdfPriv"];
-    NSUInteger i, count = [[vars valueForKey:@"dashCount"] 
unsignedIntegerValue];
-    Ivar ivar = object_getInstanceVariable(vars, "dashPattern", NULL);
-    CGFloat *dashPattern = *(CGFloat **)((void *)vars + ivar_getOffset(ivar));
     NSMutableArray *pattern = [NSMutableArray array];
-    for (i = 0; i < count; i++)
-        [pattern addObject:[NSNumber numberWithDouble:dashPattern[i]]];
+    @try {
+        id vars = [self valueForKey:@"pdfPriv"];
+        NSUInteger i, count = [[vars valueForKey:@"dashCount"] 
unsignedIntegerValue];
+        Ivar ivar = object_getInstanceVariable(vars, "dashPattern", NULL);
+        if (ivar != NULL) {
+            CGFloat *dashPattern = *(CGFloat **)((void *)vars + 
ivar_getOffset(ivar));
+            for (i = 0; i < count; i++)
+                [pattern addObject:[NSNumber numberWithDouble:dashPattern[i]]];
+        }
+    }
+    @catch (id e) {}
     return pattern;
 }
 


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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to