Revision: 29665
          http://sourceforge.net/p/bibdesk/svn/29665
Author:   hofman
Date:     2025-10-05 14:13:45 +0000 (Sun, 05 Oct 2025)
Log Message:
-----------
display if needed only once

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

Modified: trunk/bibdesk/BDSKDocumentController.m
===================================================================
--- trunk/bibdesk/BDSKDocumentController.m      2025-10-04 15:08:43 UTC (rev 
29664)
+++ trunk/bibdesk/BDSKDocumentController.m      2025-10-05 14:13:45 UTC (rev 
29665)
@@ -107,22 +107,21 @@
 }
 
 - (BibDocument *)currentBibliographyDocumentAndDisplay:(BOOL)display 
error:(NSError **)outError {
-    // try the main document first
+    // try the subject of the current script command first
     id document = [[[NSScriptCommand currentCommand] subjectSpecifier] 
objectsByEvaluatingSpecifier];
     if ([document isKindOfClass:[BibDocument class]] == NO) {
+        // try the main document first
         document = [self mainDocument];
         if ([document isKindOfClass:[BibDocument class]] == NO) {
             document = nil;
             for (document in [NSApp orderedDocuments])
                 if ([document isKindOfClass:[BibDocument class]]) break;
-            if (document == nil)
-                document = [self openUntitledDocumentAndDisplay:display 
error:outError];
-        }else if (display) {
-            [document showWindows];
         }
-    } else if (display) {
+    }
+    if (document == nil)
+        document = [self openUntitledDocumentAndDisplay:display 
error:outError];
+    else if (display)
         [document showWindows];
-    }
     return document;
 }
 

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