Revision: 30041
          http://sourceforge.net/p/bibdesk/svn/30041
Author:   hofman
Date:     2026-02-22 17:22:46 +0000 (Sun, 22 Feb 2026)
Log Message:
-----------
handle change to crossref and parent separately

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

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2026-02-22 16:51:33 UTC (rev 30040)
+++ trunk/bibdesk/BDSKEditor.m  2026-02-22 17:22:46 UTC (rev 30041)
@@ -2333,21 +2333,27 @@
                [self updateTypePopup];
         [self synchronizeWindowTitleWithDocumentName];
     }
-       else if([changeKey isEqualToString:BDSKCrossrefString] || 
parentChanged){
-        // Reset if the crossref changed, or our parent's cite key changed.
-        // If we are editing a crossref field, we should first set the new 
value, because resetFields will set the edited value. This happens when it is 
set through drag/drop
-               NSInteger editedRow = [tableView editedTextRow];
-        if (editedRow != -1 && [[fields objectAtIndex:editedRow] 
isEqualToString:changeKey])
+    else if([changeKey isEqualToString:BDSKCrossrefString]){
+        // Reset if the crossref changed.
+        // We should first set the new value, because resetFields will set the 
edited value. This happens when it is set through drag/drop
+        NSInteger editedRow = [tableView editedTextRow];
+        if (editedRow != -1 && [[fields objectAtIndex:editedRow] 
isEqualToString:BDSKCrossrefString])
             [[[self textFieldAtRow:editedRow] currentEditor] 
setString:newValue ?: @""];
         NSArray *currentFields = nil;
-        if ([changeKey isEqualToString:BDSKCrossrefString] && [NSString 
isEmptyString:newValue] != [NSString isEmptyString:oldValue])
-                       // Crossref field was added or removed
+        if ([NSString isEmptyString:newValue] != [NSString 
isEmptyString:oldValue])
+            // Crossref field was added or removed
             currentFields = [self currentFields];
         // every field value could change
         [self reloadTableWithFields:currentFields];
-               [authorTableView reloadData];
-               [self synchronizeWindowTitleWithDocumentName];
-       }
+        [authorTableView reloadData];
+        [self synchronizeWindowTitleWithDocumentName];
+    }
+    else if(parentChanged){
+        // Reset if our parent's cite key changed. Every field value could 
change.
+        [self reloadTableWithFields:nil];
+        [authorTableView reloadData];
+        [self synchronizeWindowTitleWithDocumentName];
+    }
     else if([changeKey isEqualToString:BDSKCiteKeyString]){
         [citeKeyField setStringValue:[publication citeKey]];
         [self updateCiteKeyAutoGenerateStatus];

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