Revision: 29309
          http://sourceforge.net/p/bibdesk/svn/29309
Author:   hofman
Date:     2025-07-20 14:20:05 +0000 (Sun, 20 Jul 2025)
Log Message:
-----------
no need to replace text storage string by copy

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

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2025-07-20 08:49:36 UTC (rev 29308)
+++ trunk/bibdesk/BDSKEditor.m  2025-07-20 14:20:05 UTC (rev 29309)
@@ -145,7 +145,6 @@
 - (void)reloadTableWithFields:(NSArray *)newFields;
 - (void)updateTableViewDisplay;
 - (void)registerForNotifications;
-- (void)breakTextStorageConnections;
 - (void)updateCiteKeyDuplicateWarning;
 - (void)userChangedField:(NSString *)fieldName from:(NSString *)oldValue 
to:(NSString *)newValue;
 - (void)updateStatusForAutoGenerate:(BDSKAutoGenerateStatus)mask;
@@ -2931,9 +2930,6 @@
         [self discardEditing];
     [self setEditing:NO];
     
-    // see method for notes
-    [self breakTextStorageConnections];
-    
     editorFlags.isEditable = NO;
     
     @try {
@@ -3537,14 +3533,6 @@
              object:nil];
 }
 
-
-- (void)breakTextStorageConnections {
-    
-    // This is a fix for bug #1483613 (and others).  We set some of the 
BibItem's fields to -[[NSTextView textStorage] mutableString] for efficiency in 
tracking changes for live editing updates in the main window preview.  However, 
this causes a retain cycle, as the text storage retains its text view; any font 
changes to the editor text view will cause the retained textview to message its 
delegate (BDSKEditor) which is garbage in -[NSTextView _addToTypingAttributes].
-    for (NSString *field in [[BDSKTypeManager sharedManager] noteFieldsSet])
-        [publication replaceValueOfFieldByCopy:field];
-}
-
 - (void)updateCiteKeyDuplicateWarning{
     if (editorFlags.isEditable == NO)
         return;

Modified: trunk/bibdesk/BibItem.h
===================================================================
--- trunk/bibdesk/BibItem.h     2025-07-20 08:49:36 UTC (rev 29308)
+++ trunk/bibdesk/BibItem.h     2025-07-20 14:20:05 UTC (rev 29309)
@@ -642,8 +642,6 @@
 - (void)setField: (NSString *)key toValue: (nullable NSString *)value;
 - (void)setField: (NSString *)key toValue: (nullable NSString *)value 
withModDate:(nullable NSDate *)date;
 
-- (void)replaceValueOfFieldByCopy:(NSString *)key;
-
 /*!
     @method valueOfField:
     @abstract Calls valueOfField:inherit: with inherit set to YES. 

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2025-07-20 08:49:36 UTC (rev 29308)
+++ trunk/bibdesk/BibItem.m     2025-07-20 14:20:05 UTC (rev 29309)
@@ -1165,14 +1165,6 @@
     }
 }
 
-- (void)replaceValueOfFieldByCopy:(NSString *)key{
-    NSParameterAssert(nil != key);
-    // this method is intended as a workaround for a BDSKEditor issue with 
using -[NSTextStorage mutableString] to track changes
-    NSString *value = [[pubFields objectForKey:key] copy];
-    if (value)
-        [pubFields setObject:value forKey:key];
-}
-
 - (NSString *)valueOfField: (NSString *)key{
        return [self valueOfField:key inherit:YES];
 }

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