Revision: 27456
          http://sourceforge.net/p/bibdesk/svn/27456
Author:   hofman
Date:     2022-05-22 14:53:51 +0000 (Sun, 22 May 2022)
Log Message:
-----------
Always attach or update complex string editor when value of complex edited 
field changes

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

Modified: trunk/bibdesk/BDSKComplexStringEditor.m
===================================================================
--- trunk/bibdesk/BDSKComplexStringEditor.m     2022-05-22 14:35:54 UTC (rev 
27455)
+++ trunk/bibdesk/BDSKComplexStringEditor.m     2022-05-22 14:53:51 UTC (rev 
27456)
@@ -80,8 +80,13 @@
 }
 
 - (void)attachToEditor:(NSText *)textObj {
-       if ([self isAttached]) 
+    if ([self isAttached]) {
+        if (editor == textObj) {
+            [self editorTextDidChange:nil];
+            return;
+        }
                [self remove];
+    }
     
     editor = [textObj retain];
     

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2022-05-22 14:35:54 UTC (rev 27455)
+++ trunk/bibdesk/BDSKEditor.m  2022-05-22 14:53:51 UTC (rev 27456)
@@ -2533,10 +2533,7 @@
                 // don't use newValue, because this can be the parent's value
                 NSString *tmpValue = [publication valueOfField:changeKey] ?: 
@"";
                 BDSKEditorTextField *textField = [self textFieldAtRow:row];
-                BOOL wasComplex = [tableCellFormatter editAsComplexString];
                 [textField setObjectValue:tmpValue];
-                if ([textField currentEditor] && wasComplex == NO && 
[tableCellFormatter editAsComplexString])
-                    [tableCellFormatter didStartEditor:[textField 
currentEditor]];
                 id object = nil;
                 if ([tmpValue isInherited])
                     object = [[[BDSKField alloc] initWithName:changeKey 
bibItem:nil] autorelease];
@@ -2543,6 +2540,8 @@
                 else if ([changeKey isURLField])
                     object = [publication URLForField:changeKey];
                 [textField setRepresentedObject:object];
+                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