Revision: 24143
          http://sourceforge.net/p/bibdesk/svn/24143
Author:   hofman
Date:     2019-08-16 21:03:00 +0000 (Fri, 16 Aug 2019)
Log Message:
-----------
don't drop URL dragged from main table on itself, it is almost impossible not 
to do it inadvertently

Modified Paths:
--------------
    trunk/bibdesk/BibDocument_DataSource.m

Modified: trunk/bibdesk/BibDocument_DataSource.m
===================================================================
--- trunk/bibdesk/BibDocument_DataSource.m      2019-08-16 14:15:30 UTC (rev 
24142)
+++ trunk/bibdesk/BibDocument_DataSource.m      2019-08-16 21:03:00 UTC (rev 
24143)
@@ -593,7 +593,13 @@
     
     NSPasteboard *pboard = [info draggingPasteboard];
     BOOL hasURL = [pboard canReadURL];
+    id source = [info draggingSource];
+    BOOL isDragFromMainTable = [source isEqual:tableView];
     
+    // can't copy onto same table
+    if (isDragFromMainTable)
+        return NSDragOperationNone;
+
     if (row != -1 && op == NSTableViewDropOn && 
         (hasURL || [pboard canReadObjectForClasses:[NSArray 
arrayWithObject:[NSColor class]] options:[NSDictionary dictionary]]))
         return NSDragOperationEvery;
@@ -611,8 +617,6 @@
     // We were checking -containsUnparseableFile here as well, but I think it 
makes sense to allow the user to target a specific row with any file type 
(including BibTeX).  Further, checking -containsUnparseableFile can be 
unacceptably slow (see bug #1799630), which ruins the dragging experience.
     [tv setDropRow:-1 dropOperation:NSTableViewDropOn];
     
-    id source = [info draggingSource];
-    BOOL isDragFromMainTable = [source isEqual:tableView];
     BOOL isDragFromGroupTable = [source isEqual:groupOutlineView];
     BOOL isDragFromDrawer = [source isEqual:[customCiteController tableView]];
     
@@ -619,8 +623,7 @@
     if (isDragFromGroupTable && docFlags.dragFromExternalGroups && [self 
hasGroupTypeSelected:BDSKLibraryGroupType])
         return NSDragOperationCopy;
     
-    if (isDragFromMainTable || isDragFromGroupTable || isDragFromDrawer)
-        // can't copy onto same table
+    if (isDragFromGroupTable || isDragFromDrawer)
         return NSDragOperationNone;
     
     return hasPub ? NSDragOperationCopy : NSDragOperationEvery;

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to