Revision: 29335
          http://sourceforge.net/p/bibdesk/svn/29335
Author:   hofman
Date:     2025-07-23 08:48:26 +0000 (Wed, 23 Jul 2025)
Log Message:
-----------
Do not change crossrefs and citations when a different item with the same cite 
key shadowed the item for the cite key

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

Modified: trunk/bibdesk/BibDocument_UI.m
===================================================================
--- trunk/bibdesk/BibDocument_UI.m      2025-07-22 22:47:27 UTC (rev 29334)
+++ trunk/bibdesk/BibDocument_UI.m      2025-07-23 08:48:26 UTC (rev 29335)
@@ -1430,8 +1430,9 @@
     // need to handle cite keys and crossrefs if a cite key changed
     else if([changedKey isEqualToString:BDSKCiteKeyString]){
         oldKey = [userInfo objectForKey:BDSKBibItemOldValueKey];
+        BOOL shadowedKeyItem = [publications itemForCiteKey:oldKey] != pub;
         [publications changeCiteKey:oldKey forItem:pub];
-        if([NSString isEmptyString:oldKey] || [oldKey isEqualToString:[BibItem 
defaultCiteKey]] || [NSString isEmptyString:key] || [key 
isEqualToString:[BibItem defaultCiteKey]] || [[self undoManager] isUndoing] || 
[[self undoManager] isRedoing])
+        if([NSString isEmptyString:oldKey] || [oldKey isEqualToString:[BibItem 
defaultCiteKey]] || [NSString isEmptyString:key] || [key 
isEqualToString:[BibItem defaultCiteKey]] || [[self undoManager] isUndoing] || 
[[self undoManager] isRedoing] || shadowedKeyItem)
             oldKey = nil;
     }
     else if ([changedKey isEqualToString:BDSKLocalFileString]) {

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