Revision: 29334
          http://sourceforge.net/p/bibdesk/svn/29334
Author:   hofman
Date:     2025-07-22 22:47:27 +0000 (Tue, 22 Jul 2025)
Log Message:
-----------
use else for key cases

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

Modified: trunk/bibdesk/BibDocument_UI.m
===================================================================
--- trunk/bibdesk/BibDocument_UI.m      2025-07-22 16:30:21 UTC (rev 29333)
+++ trunk/bibdesk/BibDocument_UI.m      2025-07-22 22:47:27 UTC (rev 29334)
@@ -1427,14 +1427,19 @@
         [publications changeCrossref:[userInfo 
objectForKey:BDSKBibItemOldValueKey] forItem:pub];
         changedKey = nil;
     }
-    
     // need to handle cite keys and crossrefs if a cite key changed
-    if([changedKey isEqualToString:BDSKCiteKeyString]){
+    else if([changedKey isEqualToString:BDSKCiteKeyString]){
         oldKey = [userInfo objectForKey:BDSKBibItemOldValueKey];
         [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])
             oldKey = nil;
     }
+    else if ([changedKey isEqualToString:BDSKLocalFileString]) {
+        NSDictionary *notifInfo = @{BDSKDocumentPublicationsKey:@[pub]};
+        [[NSNotificationCenter defaultCenter] 
postNotificationName:BDSKDocumentDidChangeLinkedFilesNotification
+                                                            object:self
+                                                          userInfo:notifInfo];
+    }
     
     // All Fields contains all dependencies of any search field
     BOOL shouldReindex = isEdit == NO && 
searchKeyDependsOnKey(BDSKAllFieldsString, changedKey);
@@ -1441,13 +1446,6 @@
     if (shouldReindex)
         [publications reindexPublications:@[pub]];
     
-    if ([changedKey isEqualToString:BDSKLocalFileString]) {
-        NSDictionary *notifInfo = @{BDSKDocumentPublicationsKey:@[pub]};
-        [[NSNotificationCenter defaultCenter] 
postNotificationName:BDSKDocumentDidChangeLinkedFilesNotification
-                                                            object:self
-                                                          userInfo:notifInfo];
-    }
-    
     if ([changedKey isNoteField] == NO && [changedKey isGeneralURLField] == NO 
&& [changedKey isIntegerField] == NO && [changedKey 
isEqualToString:BDSKPubTypeString] == NO) {
         NSArray *crossreffedItems = [publications itemsForCrossref:key];
         if ([crossreffedItems count]) {

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



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to