Revision: 27284
          http://sourceforge.net/p/bibdesk/svn/27284
Author:   hofman
Date:     2022-03-08 14:46:39 +0000 (Tue, 08 Mar 2022)
Log Message:
-----------
No need for change count anymore

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

Modified: trunk/bibdesk/BDSKItemPasteboardHelper.m
===================================================================
--- trunk/bibdesk/BDSKItemPasteboardHelper.m    2022-03-08 10:40:22 UTC (rev 
27283)
+++ trunk/bibdesk/BDSKItemPasteboardHelper.m    2022-03-08 14:46:39 UTC (rev 
27284)
@@ -48,7 +48,6 @@
 #define ARCHIVEDDATA_KEY @"archivedData"
 #define BIBTEXSTRING_KEY @"bibTeXString"
 #define CITEKEYS_KEY @"citeKeys"
-#define CHANGECOUNT_KEY @"changeCount"
 
 
 @interface BDSKItemPasteboardHelper (Private)
@@ -56,8 +55,6 @@
 - (BOOL)pasteboardIsValid:(NSPasteboard *)pboard;
 - (NSMutableArray *)promisedTypesForPasteboard:(NSPasteboard *)pboard;
 - (void)setPromisedTypes:(NSMutableArray *)types items:(NSArray *)items 
dragCopyType:(BDSKDragCopyType)dragCopyType forPasteboard:(NSPasteboard 
*)pboard;
-- (void)setChangeCountForPasteboard:(NSPasteboard *)pboard;
-- (BOOL)isProviderForPasteboard:(NSPasteboard *)pboard;
 - (void)removePromisedType:(NSString *)type forPasteboard:(NSPasteboard 
*)pboard;
 - (void)removePromisedTypesForPasteboard:(NSPasteboard *)pboard;
 
@@ -146,8 +143,6 @@
     [item setDataProvider:self forTypes:types];
     if (needsWrite)
         [pboard writeObjects:[NSArray arrayWithObjects:item, nil]];
-    // in case the write has changed the changeCount
-    [self setChangeCountForPasteboard:pboard];
 }
 
 #pragma mark NSPasteboardItemDataProvider protocol methods
@@ -297,7 +292,7 @@
 
 - (void)setPromisedTypes:(NSMutableArray *)types items:(NSArray *)items 
dragCopyType:(BDSKDragCopyType)dragCopyType forPasteboard:(NSPasteboard 
*)pboard {
     if ([self pasteboardIsValid:pboard]) {
-        NSMutableDictionary *dict = [NSMutableDictionary 
dictionaryWithObjectsAndKeys:types, TYPES_KEY, [NSNumber 
numberWithInteger:dragCopyType], DRAGCOPYTYPE_KEY, [NSNumber 
numberWithInteger:[pboard changeCount]], CHANGECOUNT_KEY, nil];
+        NSMutableDictionary *dict = [NSMutableDictionary 
dictionaryWithObjectsAndKeys:types, TYPES_KEY, [NSNumber 
numberWithInteger:dragCopyType], DRAGCOPYTYPE_KEY, nil];
         if (pboard == [NSPasteboard generalPasteboard]) {
             // Save intermediate data for the clipboard, as the items may 
change before pasting
             NSString *bibString = [delegate pasteboardHelper:self 
bibTeXStringForItems:items];
@@ -321,15 +316,6 @@
     }
 }
 
-- (void)setChangeCountForPasteboard:(NSPasteboard *)pboard {
-    if ([self pasteboardIsValid:pboard])
-        [[promisedPboardTypes objectForKey:[pboard name]] setObject:[NSNumber 
numberWithInteger:[pboard changeCount]] forKey:CHANGECOUNT_KEY];
-}
-
-- (BOOL)isProviderForPasteboard:(NSPasteboard *)pboard {
-    return [pboard changeCount] == [[[promisedPboardTypes objectForKey:[pboard 
name]] objectForKey:CHANGECOUNT_KEY] integerValue];
-}
-
 - (void)removePromisedType:(NSString *)type forPasteboard:(NSPasteboard 
*)pboard {
        NSMutableArray *types = [self promisedTypesForPasteboard:pboard];
        [types removeObject:type];

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