Revision: 29340
          http://sourceforge.net/p/bibdesk/svn/29340
Author:   hofman
Date:     2025-07-23 15:02:53 +0000 (Wed, 23 Jul 2025)
Log Message:
-----------
Note fields won't be the edited mutale string anymore, so don't copy or not set 
them to nil

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

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2025-07-23 14:38:22 UTC (rev 29339)
+++ trunk/bibdesk/BibItem.m     2025-07-23 15:02:53 UTC (rev 29340)
@@ -1122,13 +1122,13 @@
 
 - (void)setField:(NSString *)key toValue:(NSString *)value withModDate:(NSDate 
*)date{
     BDSKPRECONDITION(key != nil);
-    // use a copy of the old value, since this may be a mutable value
-    NSString *oldValue = [[pubFields objectForKey:key] copy];
-    if ([oldValue isEqualAsComplexString:@""]) {
+    NSString *oldValue = [pubFields objectForKey:key];
+    if ([oldValue isEqualAsComplexString:@""])
         oldValue = nil;
-    }
-    if ([value isEqualAsComplexString:@""] && [key isNoteField] == NO)
+    if ([value isEqualAsComplexString:@""])
         value = nil;
+    if (oldValue == nil && value == nil)
+        return;
     if ([self undoManager]) {
                [[[self undoManager] prepareWithInvocationTarget:self] 
setField:key 
                                                                                
                                 toValue:oldValue
@@ -1155,7 +1155,7 @@
                 [[BDSKCompletionManager sharedManager] addString:value 
forCompletionEntry:key];
         }
 
-        NSMutableDictionary *notifInfo = [NSMutableDictionary 
dictionaryWithObjectsAndKeys:key, BDSKBibItemKeyKey, nil];
+        NSMutableDictionary *notifInfo = [NSMutableDictionary 
dictionaryWithObject:key forKey:BDSKBibItemKeyKey];
         [notifInfo setValue:value forKey:BDSKBibItemNewValueKey];
         [notifInfo setValue:oldValue forKey:BDSKBibItemOldValueKey];
         [[NSNotificationCenter defaultCenter] 
postNotificationName:BDSKBibItemChangedNotification

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