Revision: 7426
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7426&view=rev
Author:   hofman
Date:     2011-08-10 17:18:24 +0000 (Wed, 10 Aug 2011)

Log Message:
-----------
make suer we have the right kind of pdfview before sending custom methods

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

Modified: trunk/PDFDisplayView_SKExtensions.m
===================================================================
--- trunk/PDFDisplayView_SKExtensions.m 2011-08-08 09:23:53 UTC (rev 7425)
+++ trunk/PDFDisplayView_SKExtensions.m 2011-08-10 17:18:24 UTC (rev 7426)
@@ -263,12 +263,16 @@
 }
 
 - (BOOL)isFauxUIElementFocused:(SKAccessibilityFauxUIElement *)element {
-    return [SKGetPDFView(self) activeAnnotation] == [element 
representedObject];
+    SKPDFView *pdfView = SKGetPDFView(self);
+    if ([pdfView respondsToSelector:@selector(activeAnnotation)])
+        return [pdfView activeAnnotation] == [element representedObject];
+    else
+        return NO;
 }
 
 - (void)fauxUIlement:(SKAccessibilityFauxUIElement *)element 
setFocused:(BOOL)focused {
     SKPDFView *pdfView = SKGetPDFView(self);
-    if (pdfView) {
+    if ([pdfView respondsToSelector:@selector(setActiveAnnotation:)]) {
         PDFAnnotation *annotation = [element representedObject];
         if ([annotation isKindOfClass:[PDFAnnotation class]]) {
             if (focused)
@@ -281,7 +285,7 @@
 
 - (void)pressFauxUIElement:(SKAccessibilityFauxUIElement *)element {
     SKPDFView *pdfView = SKGetPDFView(self);
-    if (pdfView) {
+    if ([pdfView respondsToSelector:@selector(activeAnnotation)] && [pdfView 
respondsToSelector:@selector(setActiveAnnotation:)] && [pdfView 
respondsToSelector:@selector(editActiveAnnotation:)]) {
         PDFAnnotation *annotation = [element representedObject];
         if ([annotation isKindOfClass:[PDFAnnotation class]]) {
             if ([pdfView activeAnnotation] != annotation)


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

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to