Revision: 28323
          http://sourceforge.net/p/bibdesk/svn/28323
Author:   hofman
Date:     2023-07-17 14:16:45 +0000 (Mon, 17 Jul 2023)
Log Message:
-----------
ignore temporary save target URL when duplicating

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

Modified: trunk/bibdesk/BibDocument.h
===================================================================
--- trunk/bibdesk/BibDocument.h 2023-07-17 09:15:42 UTC (rev 28322)
+++ trunk/bibdesk/BibDocument.h 2023-07-17 14:16:45 UTC (rev 28323)
@@ -268,6 +268,7 @@
         unsigned int        isDocumentClosed:1;
         unsigned int        isExporting:1;
         unsigned int        isSaving:1;
+        unsigned int        isDuplicating:1;
         unsigned int        aggregateImport:1;
         unsigned int        displayMigrationAlert:1;
         unsigned int        inOptionKeyState:1;

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2023-07-17 09:15:42 UTC (rev 28322)
+++ trunk/bibdesk/BibDocument.m 2023-07-17 14:16:45 UTC (rev 28323)
@@ -1212,7 +1212,8 @@
 
 - (BOOL)writeSafelyToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName 
forSaveOperation:(NSSaveOperationType)saveOperation error:(NSError **)outError;
 {
-    saveTargetURL = [absoluteURL copy];
+    if (docFlags.isDuplicating == NO)
+        saveTargetURL = [absoluteURL copy];
     
     BOOL didSave = [super writeSafelyToURL:absoluteURL ofType:typeName 
forSaveOperation:saveOperation error:outError];
     
@@ -1253,7 +1254,10 @@
 
 - (id)duplicateAndReturnError:(NSError **)outError {
     [[NSDocumentController sharedDocumentController] willDuplicateTemplate:NO 
withEncoding:[self documentStringEncoding]];
-    return [super duplicateAndReturnError:outError];
+    docFlags.isDuplicating = YES;
+    id doc = [super duplicateAndReturnError:outError];
+    docFlags.isDuplicating = NO;
+    return doc;
 }
 
 - (BOOL)writeArchiveToURL:(NSURL *)fileURL error:(NSError **)outError{

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