Revision: 27530
          http://sourceforge.net/p/bibdesk/svn/27530
Author:   hofman
Date:     2022-06-03 09:28:26 +0000 (Fri, 03 Jun 2022)
Log Message:
-----------
Don't use convenience method to add a linked URL in numdam parser, as this 
should override the field and insert the linked URL at the start

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

Modified: trunk/bibdesk/BDSKNumdamParser.m
===================================================================
--- trunk/bibdesk/BDSKNumdamParser.m    2022-06-03 09:25:52 UTC (rev 27529)
+++ trunk/bibdesk/BDSKNumdamParser.m    2022-06-03 09:28:26 UTC (rev 27530)
@@ -155,8 +155,16 @@
             if ([match count] >= 2) {
                 NSString * myURLString = [[match string] 
substringWithRange:[match rangeAtIndex:1]];
                 
-                if ( myURLString )
-                    [item addURLString:myURLString];
+                if ( myURLString ) {
+                    NSUserDefaults *sud = [NSUserDefaults 
standardUserDefaults];
+                    BOOL addLinkedFiles = NO == [sud 
boolForKey:BDSKUseLocalUrlAndUrlKey];
+                    BOOL addUrlField = addLinkedFiles == NO || [sud 
boolForKey:BDSKAutomaticallyConvertURLFieldsKey] == NO || [sud 
boolForKey:BDSKRemoveConvertedRemoteURLFieldsKey] == NO;
+                    
+                    if ( addUrlField )
+                        [item setField:BDSKUrlString toValue:myURLString];
+                    if ( addLinkedFiles )
+                        [item insertObject:[BDSKLinkedFile 
linkedFileWithURLString:myURLString] inFilesAtIndex:0];
+                }
             }
         }
     }

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