Revision: 4919
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4919&view=rev
Author:   hofman
Date:     2008-11-06 18:49:47 +0000 (Thu, 06 Nov 2008)

Log Message:
-----------
Remove copy: menu item from contextual menu items of non-selectable pdfviews

Modified Paths:
--------------
    trunk/BDSKZoomablePDFView.m
    trunk/SKSecondaryPDFView.m

Modified: trunk/BDSKZoomablePDFView.m
===================================================================
--- trunk/BDSKZoomablePDFView.m 2008-11-05 13:48:48 UTC (rev 4918)
+++ trunk/BDSKZoomablePDFView.m 2008-11-06 18:49:47 UTC (rev 4919)
@@ -341,9 +341,8 @@
 - (NSMenu *)menuForEvent:(NSEvent *)theEvent {
     static NSSet *selectionActions = nil;
     if (selectionActions == nil)
-        selectionActions = [[NSSet alloc] 
initWithObjects:@"_searchInSpotlight:", @"_searchInGoogle:", 
@"_searchInDictionary:", nil];
+        selectionActions = [[NSSet alloc] initWithObjects:@"copy:", 
@"_searchInSpotlight:", @"_searchInGoogle:", @"_searchInDictionary:", nil];
     NSMenu *menu = [super menuForEvent:theEvent];
-    int i, count = [menu numberOfItems];
     
     [self setCurrentSelection:nil];
     while ([menu numberOfItems]) {
@@ -354,13 +353,9 @@
             break;
     }
     
-    for (i = 0; i < count; i++) {
-        NSMenuItem *item = [menu itemAtIndex:i];
-        if ([item action] == NSSelectorFromString(@"_setAutoSize:")) {
-            [item setAction:@selector(doAutoFit:)];
-            break;
-        }
-    }
+    unsigned int i = [menu indexOfItemWithTarget:self 
andAction:NSSelectorFromString(@"_setAutoSize:")];
+    if (i != NSNotFound)
+        [[menu itemAtIndex:i] setAction:@selector(doAutoFit:)];
     
     return menu;
 }

Modified: trunk/SKSecondaryPDFView.m
===================================================================
--- trunk/SKSecondaryPDFView.m  2008-11-05 13:48:48 UTC (rev 4918)
+++ trunk/SKSecondaryPDFView.m  2008-11-06 18:49:47 UTC (rev 4919)
@@ -469,7 +469,7 @@
 - (NSMenu *)menuForEvent:(NSEvent *)theEvent {
     static NSSet *selectionActions = nil;
     if (selectionActions == nil)
-        selectionActions = [[NSSet alloc] 
initWithObjects:@"_searchInSpotlight:", @"_searchInGoogle:", 
@"_searchInDictionary:", nil];
+        selectionActions = [[NSSet alloc] initWithObjects:@"copy:", 
@"_searchInSpotlight:", @"_searchInGoogle:", @"_searchInDictionary:", nil];
     NSMenu *menu = [super menuForEvent:theEvent];
     NSMenuItem *item;
     


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