Revision: 13653
          http://sourceforge.net/p/skim-app/code/13653
Author:   hofman
Date:     2023-09-10 08:32:12 +0000 (Sun, 10 Sep 2023)
Log Message:
-----------
disable paste actions in pdfview when not in text or note tool mode

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2023-09-09 22:55:38 UTC (rev 13652)
+++ trunk/SKPDFView.m   2023-09-10 08:32:12 UTC (rev 13653)
@@ -3476,11 +3476,11 @@
             return YES;
         return NO;
     } else if (action == @selector(paste:)) {
-        return interactionMode != SKPresentationMode && [[NSPasteboard 
generalPasteboard] canReadObjectForClasses:@[[PDFAnnotation class], [NSString 
class]] options:@{}];
+        return interactionMode != SKPresentationMode && (toolMode == 
SKTextToolMode || toolMode == SKNoteToolMode) && [[NSPasteboard 
generalPasteboard] canReadObjectForClasses:@[[PDFAnnotation class], [NSString 
class]] options:@{}];
     } else if (action == @selector(alternatePaste:)) {
-        return interactionMode != SKPresentationMode && [[NSPasteboard 
generalPasteboard] canReadObjectForClasses:@[[PDFAnnotation class], 
[NSAttributedString class], [NSString class]] options:@{}];
+        return interactionMode != SKPresentationMode && (toolMode == 
SKTextToolMode || toolMode == SKNoteToolMode) && [[NSPasteboard 
generalPasteboard] canReadObjectForClasses:@[[PDFAnnotation class], 
[NSAttributedString class], [NSString class]] options:@{}];
     } else if (action == @selector(pasteAsPlainText:)) {
-        return interactionMode != SKPresentationMode && [[NSPasteboard 
generalPasteboard] canReadObjectForClasses:@[[NSAttributedString class], 
[NSString class]] options:@{}];
+        return interactionMode != SKPresentationMode && (toolMode == 
SKTextToolMode || toolMode == SKNoteToolMode) && [[NSPasteboard 
generalPasteboard] canReadObjectForClasses:@[[NSAttributedString class], 
[NSString class]] options:@{}];
     } else if (action == @selector(delete:)) {
         return [currentAnnotation isSkimNote];
     } else if (action == @selector(selectAll:)) {

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



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to