Revision: 28582
          http://sourceforge.net/p/bibdesk/svn/28582
Author:   hofman
Date:     2024-01-10 18:45:21 +0000 (Wed, 10 Jan 2024)
Log Message:
-----------
remove object from map table when setting to nil

Modified Paths:
--------------
    trunk/bibdesk/BDSKMacroResolver.m
    trunk/bibdesk/BibDocument.m

Modified: trunk/bibdesk/BDSKMacroResolver.m
===================================================================
--- trunk/bibdesk/BDSKMacroResolver.m   2024-01-10 18:29:16 UTC (rev 28581)
+++ trunk/bibdesk/BDSKMacroResolver.m   2024-01-10 18:45:21 UTC (rev 28582)
@@ -240,7 +240,10 @@
     } else {
         type = BDSKMacroResolverChangeType;
     }
-    [macroDefinitions setValue:value forKey:macro];
+    if (value)
+        [macroDefinitions setObject:value forKey:macro];
+    else
+        [macroDefinitions removeObjectForKey:macro];
        
     modification++;
     [self synchronize];

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2024-01-10 18:29:16 UTC (rev 28581)
+++ trunk/bibdesk/BibDocument.m 2024-01-10 18:45:21 UTC (rev 28582)
@@ -958,7 +958,10 @@
 
 - (void)setDocumentInfo:(NSString *)value forKey:(NSString *)key {
     [[[self undoManager] prepareWithInvocationTarget:self] 
setDocumentInfo:[documentInfo objectForKey:key] forKey:key];
-    [documentInfo setObject:value forKey:key];
+    if (value)
+        [documentInfo setObject:value forKey:key];
+    else
+        [documentInfo removeObjectForKey:key];
 }
 
 - (id)valueForUndefinedKey:(NSString *)key{

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