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

Log Message:
-----------
use more specific condition to workaround 64-bit bug in PDFBorder, so it will 
be ignored when Apple fixes it in the future

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

Modified: trunk/PDFBorder_SKExtensions.m
===================================================================
--- trunk/PDFBorder_SKExtensions.m      2009-09-05 19:08:25 UTC (rev 5685)
+++ trunk/PDFBorder_SKExtensions.m      2009-09-05 19:40:40 UTC (rev 5686)
@@ -40,7 +40,7 @@
 #import "SKRuntime.h"
 #import <objc/objc-runtime.h>
 
-
+/*
 @interface PDFBorderPrivateVars : NSObject
 {
     NSUInteger style;
@@ -51,8 +51,8 @@
     CGFloat *dashPattern;
 }
 @end
+*/
 
-
 @implementation PDFBorder (SKExtensions)
 
 - (id)copyWithZone:(NSZone *)aZone {
@@ -81,9 +81,13 @@
 }
 
 + (void)load {
-    // on 10.6 the implementation of -dashPattern is badly broken, probably 
due to the wrong type for _pdfPriv.dashCount
-    if (floor(NSAppKitVersionNumber) > 949)
-        original_dashPattern = (id (*)(id, 
SEL))SKReplaceInstanceMethodImplementationFromSelector(self, 
@selector(dashPattern), @selector(replacement_dashPattern));
+    // the implementation of -dashPattern is currently badly broken, probably 
due to the wrong type for _pdfPriv.dashCount
+    Class cls = NSClassFromString(@"PDFBorderPrivateVars");
+    if (cls) {
+        Ivar ivar = class_getInstanceVariable(cls, "dashCount");
+        if (ivar && 0 != strcmp(ivar_getTypeEncoding(ivar), 
@encode(NSUInteger)))
+            original_dashPattern = (id (*)(id, 
SEL))SKReplaceInstanceMethodImplementationFromSelector(self, 
@selector(dashPattern), @selector(replacement_dashPattern));
+    }
 }
 
 #endif


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