Revision: 30052
          http://sourceforge.net/p/bibdesk/svn/30052
Author:   hofman
Date:     2026-02-24 17:21:29 +0000 (Tue, 24 Feb 2026)
Log Message:
-----------
revert previous commit, field is not yet known when a custom field is added

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

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2026-02-24 17:09:45 UTC (rev 30051)
+++ trunk/bibdesk/BDSKEditor.m  2026-02-24 17:21:29 UTC (rev 30052)
@@ -2416,20 +2416,18 @@
             [authorTableView reloadData];
         
         NSInteger row = [fields indexOfObject:changeKey];
-        if (row != NSNotFound) {
-            if (row >= minNumberOfFields && ([NSString 
isEmptyAsComplexString:newValue] != [NSString 
isEmptyAsComplexString:oldValue])) {
-                // a custom field was added or removed
-                [self reloadTableIgnoringEditsForField:changeKey];
-            } else {
-                // a field value changed
-                // don't use newValue, because this can be the parent's value
-                NSString *tmpValue = [publication valueOfField:changeKey] ?: 
@"";
-                BDSKEditorTextField *textField = [self textFieldAtRow:row];
-                [textField setObjectValue:tmpValue];
-                [textField setRepresentedObject:[self 
representedObjectForValue:tmpValue forField:changeKey]];
-                if ([textField currentEditor] && [tableCellFormatter 
editAsComplexString])
-                    [tableCellFormatter didStartEditor:[textField 
currentEditor]];
-            }
+        if (row >= minNumberOfFields && ([NSString 
isEmptyAsComplexString:newValue] != [NSString 
isEmptyAsComplexString:oldValue])) {
+                       // a custom field was added or removed
+            [self reloadTableIgnoringEditsForField:changeKey];
+        } else if (row != NSNotFound) {
+            // a field value changed
+            // don't use newValue, because this can be the parent's value
+            NSString *tmpValue = [publication valueOfField:changeKey] ?: @"";
+            BDSKEditorTextField *textField = [self textFieldAtRow:row];
+            [textField setObjectValue:tmpValue];
+            [textField setRepresentedObject:[self 
representedObjectForValue:tmpValue forField:changeKey]];
+            if ([textField currentEditor] && [tableCellFormatter 
editAsComplexString])
+                [tableCellFormatter didStartEditor:[textField currentEditor]];
         }
     }
     

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