Revision: 28470
          http://sourceforge.net/p/bibdesk/svn/28470
Author:   hofman
Date:     2023-12-06 16:40:15 +0000 (Wed, 06 Dec 2023)
Log Message:
-----------
Add attributes to exported RTFD from template

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

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2023-12-06 16:36:39 UTC (rev 28469)
+++ trunk/bibdesk/BibDocument.m 2023-12-06 16:40:15 UTC (rev 28470)
@@ -1730,7 +1730,13 @@
     
     NSDictionary *docAttributes = nil;
     NSAttributedString *fileTemplate = [BDSKTemplateObjectProxy 
attributedStringByParsingTemplate:template withObject:self publications:[self 
publicationsForSaving] documentAttributes:&docAttributes];
+    NSMutableDictionary *mutableAttributes = [NSMutableDictionary 
dictionaryWithDictionary:docAttributes];
     
+    // create some useful metadata, with an option to disable for the paranoid
+    if(NO == [[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKDisableExportAttributesKey])
+        [mutableAttributes 
addEntriesFromDictionary:@{NSAuthorDocumentAttribute:NSFullUserName(), 
NSCreationTimeDocumentAttribute:[NSDate date], 
NSTitleDocumentAttribute:[NSLocalizedString(@"BibDesk export of ", @"Error 
description") stringByAppendingString:[[[self fileURL] path] 
lastPathComponent]]}];
+    [mutableAttributes setObject:NSRTFDTextDocumentType 
forKey:NSDocumentTypeDocumentAttribute];
+    
     return [fileTemplate RTFDFileWrapperFromRange:NSMakeRange(0,[fileTemplate 
length]) documentAttributes:docAttributes];
 }
 

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