Revision: 26702
          http://sourceforge.net/p/bibdesk/svn/26702
Author:   hofman
Date:     2021-08-20 13:55:00 +0000 (Fri, 20 Aug 2021)
Log Message:
-----------
Just change the key

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

Modified: trunk/bibdesk/BibDocument_DataSource.m
===================================================================
--- trunk/bibdesk/BibDocument_DataSource.m      2021-08-20 13:50:30 UTC (rev 
26701)
+++ trunk/bibdesk/BibDocument_DataSource.m      2021-08-20 13:55:00 UTC (rev 
26702)
@@ -756,28 +756,24 @@
         // to avoid calling it twice on -reloadData, but that will only work 
if -reloadData reloads
         // all rows instead of just visible rows.
         
-        NSUInteger i, count = [shownPublications count];
-        NSMutableArray *a = [NSMutableArray arrayWithCapacity:count];
         static NSSet *ignoredFields = nil;
         if (ignoredFields == nil)
             ignoredFields = [[NSSet alloc] initWithObjects:BDSKCrossrefString, 
BDSKImportOrderString, BDSKRelevanceString, BDSKColorLabelString, 
BDSKColorString, nil];
+        NSString *key = sortKey;
+        // table datasource returns an NSImage for URL fields, and NSNumber 
for various buttons, so we'll ignore those columns
+        if (nil == sortKey || [sortKey isGeneralURLField] || [sortKey 
isIntegerField] || [ignoredFields containsObject:sortKey])
+            key = BDSKTitleString;
         
-        // table datasource returns an NSImage for URL fields, so we'll ignore 
those columns
-        if(nil != sortKey && [sortKey isGeneralURLField] == NO && [sortKey 
isIntegerField] == NO && [ignoredFields containsObject:sortKey] == NO){
-            BibItem *pub;
-            id value;
-            
-            for (i = 0; i < count; i++){
-                pub = [shownPublications objectAtIndex:i];
-                value = [pub displayValueOfField:sortKey];
-                
-                // use @"" for nil values; ensure typeahead index matches 
shownPublications index
-                [a addObject:[value description] ?: @""];
-            }
-        }else{
-            for (i = 0; i < count; i++)
-                [a addObject:[[shownPublications objectAtIndex:i] title] ?: 
@""];
+        NSUInteger i, count = [shownPublications count];
+        NSMutableArray *a = [NSMutableArray arrayWithCapacity:count];
+        
+        for (i = 0; i < count; i++){
+            BibItem *pub = [shownPublications objectAtIndex:i];
+            id value = [pub displayValueOfField:sortKey];
+            // use @"" for nil values; ensure typeahead index matches 
shownPublications index
+            [a addObject:[value description] ?: @""];
         }
+        
         return a;
         
     }

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