Revision: 27449
          http://sourceforge.net/p/bibdesk/svn/27449
Author:   hofman
Date:     2022-05-21 17:15:27 +0000 (Sat, 21 May 2022)
Log Message:
-----------
Reorder conditions. Make sure window title and author table are updated when 
all fields chaange.

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

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2022-05-21 09:32:23 UTC (rev 27448)
+++ trunk/bibdesk/BDSKEditor.m  2022-05-21 17:15:27 UTC (rev 27449)
@@ -2478,10 +2478,38 @@
         if (idx != NSNotFound)
             [[(BDSKEditorCollectionViewItem *)[collectionView itemAtIndex:idx] 
button] setIntegerValue:[publication integerValueOfField:changeKey]];
        }
-    else if([changeKey isEqualToString:BDSKColorString]){
-        // ignore
+    else if (changeKey == nil){
+        // all fields are set
+        NSInteger editedRow = [tableView editedTextRow];
+        if (editedRow != -1) {
+            NSString *key = [fields objectAtIndex:editedRow];
+            NSString *tmpValue = [publication valueOfField:key] ?: @"";
+            NSTextField *textField = [self textFieldAtRow:editedRow];
+            [[textField currentEditor] setString:[textField formatter] ? 
[[textField formatter] editingStringForObjectValue:tmpValue] : tmpValue];
+        }
+        [self resetFields];
+        [self setupCollectionView];
+        [self synchronizeWindowTitleWithDocumentName];
+        [authorTableView reloadData];
+        if (editorFlags.ignoreFieldChange == NO) {
+           // make a copy of the current value, so we don't overwrite it when 
we set the field value to the text storage
+            NSString *tmpValue = [[publication valueOfField:BDSKAnnoteString 
inherit:NO] copy];
+            [notesView setString:(tmpValue == nil ? @"" : tmpValue)];
+            [tmpValue release];
+            tmpValue = [[publication valueOfField:BDSKAbstractString 
inherit:NO] copy];
+            [abstractView setString:(tmpValue == nil ? @"" : tmpValue)];
+            [tmpValue release];
+            tmpValue = [[publication valueOfField:BDSKRssDescriptionString 
inherit:NO] copy];
+            [rssDescriptionView setString:(tmpValue == nil ? @"" : tmpValue)];
+            [tmpValue release];
+            if(currentEditedView)
+                [[self window] makeFirstResponder:[self window]];
+            [notesViewUndoManager removeAllActions];
+            [abstractViewUndoManager removeAllActions];
+            [rssDescriptionViewUndoManager removeAllActions];
+        }
     }
-    else if (changeKey){
+    else if([changeKey isEqualToString:BDSKColorString] == NO){
         // this is a normal field displayed in the tableView
         
         if([changeKey isEqualToString:BDSKTitleString] || [changeKey 
isEqualToString:BDSKChapterString] || [changeKey 
isEqualToString:BDSKPagesString])
@@ -2519,35 +2547,6 @@
             }
         }
     }
-       else{
-        // changeKey == nil, all fields are set
-        NSInteger editedRow = [tableView editedTextRow];
-        if (editedRow != -1) {
-            NSString *key = [fields objectAtIndex:editedRow];
-            NSString *tmpValue = [publication valueOfField:key] ?: @"";
-            NSTextField *textField = [self textFieldAtRow:editedRow];
-            [[textField currentEditor] setString:[textField formatter] ? 
[[textField formatter] editingStringForObjectValue:tmpValue] : tmpValue];
-        }
-               [self resetFields];
-        [self setupCollectionView];
-        if (editorFlags.ignoreFieldChange == NO) {
-           // make a copy of the current value, so we don't overwrite it when 
we set the field value to the text storage
-            NSString *tmpValue = [[publication valueOfField:BDSKAnnoteString 
inherit:NO] copy];
-            [notesView setString:(tmpValue == nil ? @"" : tmpValue)];
-            [tmpValue release];
-            tmpValue = [[publication valueOfField:BDSKAbstractString 
inherit:NO] copy];
-            [abstractView setString:(tmpValue == nil ? @"" : tmpValue)];
-            [tmpValue release];
-            tmpValue = [[publication valueOfField:BDSKRssDescriptionString 
inherit:NO] copy];
-            [rssDescriptionView setString:(tmpValue == nil ? @"" : tmpValue)];
-            [tmpValue release];
-            if(currentEditedView)
-                [[self window] makeFirstResponder:[self window]];
-            [notesViewUndoManager removeAllActions];
-            [abstractViewUndoManager removeAllActions];
-            [rssDescriptionViewUndoManager removeAllActions];
-        }
-       }
     
 }
        

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