Revision: 9508
          http://sourceforge.net/p/skim-app/code/9508
Author:   hofman
Date:     2017-11-27 21:42:04 +0000 (Mon, 27 Nov 2017)
Log Message:
-----------
default implementation to get pdfview

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

Modified: trunk/PDFDisplayView_SKExtensions.m
===================================================================
--- trunk/PDFDisplayView_SKExtensions.m 2017-11-27 18:59:20 UTC (rev 9507)
+++ trunk/PDFDisplayView_SKExtensions.m 2017-11-27 21:42:04 UTC (rev 9508)
@@ -61,8 +61,6 @@
 
 #pragma mark -
 
-static id (*SKGetPDFView)(id self) = NULL;
-
 static id SKGetPDFView_method_getPDFView(id self) {
     return [self getPDFView];
 }
@@ -86,9 +84,12 @@
 }
 
 static id SKGetPDFView_fallback(id self) {
-    return nil;
+    id pdfView = [[self enclosingScrollView] superview];
+    return [pdfView isKindOfClass:[PDFView class]] ? pdfView : nil;
 }
 
+static id (*SKGetPDFView)(id self) = SKGetPDFView_fallback;
+
 static void (*original_updateTrackingAreas)(id, SEL) = NULL;
 
 static id (*original_accessibilityParameterizedAttributeNames)(id, SEL) = NULL;
@@ -220,8 +221,6 @@
         SKGetPDFView = SKGetPDFView_ivar_pdfView;
     else if (class_getInstanceVariable(PDFDisplayViewClass, "_private") || 
class_getInstanceVariable(PDFDisplayViewClass, "private"))
         SKGetPDFView = SKGetPDFView_ivar_private_pdfView;
-    else
-        SKGetPDFView = SKGetPDFView_fallback;
 
     original_updateTrackingAreas = (void (*)(id, 
SEL))SKReplaceInstanceMethodImplementation(PDFDisplayViewClass, 
@selector(updateTrackingAreas), (IMP)replacement_updateTrackingAreas);
     

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to