Revision: 27267
http://sourceforge.net/p/bibdesk/svn/27267
Author: hofman
Date: 2022-03-05 18:34:33 +0000 (Sat, 05 Mar 2022)
Log Message:
-----------
Try to write item to pasteboard all the way at the end, so nothing can come in
between
Modified Paths:
--------------
trunk/bibdesk/BDSKItemPasteboardHelper.m
Modified: trunk/bibdesk/BDSKItemPasteboardHelper.m
===================================================================
--- trunk/bibdesk/BDSKItemPasteboardHelper.m 2022-03-05 07:30:16 UTC (rev
27266)
+++ trunk/bibdesk/BDSKItemPasteboardHelper.m 2022-03-05 18:34:33 UTC (rev
27267)
@@ -115,15 +115,16 @@
[pboard clearContents];
- if (text != nil)
- [pboard writeObjects:[NSArray arrayWithObjects:text, nil]];
- else if (dragCopyType == BDSKDragCopyURL)
+ NSPasteboardItem *item = nil;
+
+ if (dragCopyType == BDSKDragCopyURL) {
[pboard writeURLs:[items valueForKey:@"bdskURL"] names:[items
valueForKey:@"citeKey"]];
-
- if ([[pboard pasteboardItems] count] > 0) {
- [[[pboard pasteboardItems] firstObject] setDataProvider:self
forTypes:types];
- } else {
- NSPasteboardItem *item = [[[NSPasteboardItem alloc] init] autorelease];
+ item = [[pboard pasteboardItems] firstObject];
+ }
+ if (item == nil) {
+ item = [[[NSPasteboardItem alloc] init] autorelease];
+ if (text)
+ [item setString:text forType:NSPasteboardTypeString];
[item setDataProvider:self forTypes:types];
[pboard writeObjects:[NSArray arrayWithObjects:item, nil]];
}
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