Revision: 13558
          http://sourceforge.net/p/skim-app/code/13558
Author:   hofman
Date:     2023-08-03 22:10:54 +0000 (Thu, 03 Aug 2023)
Log Message:
-----------
No need to reset splitview when loading locked document, as we are using auto 
layout throughout the window. Don't apply crop boxes to locked document, we do 
that delayed when the document is unlocked.

Modified Paths:
--------------
    trunk/SKMainWindowController.m

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2023-08-03 17:48:54 UTC (rev 13557)
+++ trunk/SKMainWindowController.m      2023-08-03 22:10:54 UTC (rev 13558)
@@ -476,18 +476,8 @@
         [leftSideController.button setEnabled:NO 
forSegment:SKSidePaneStateOutline];
     
     // Due to a bug in Leopard we should only resize and swap in the PDFView 
after loading the PDFDocument
-    if ([[pdfView document] isLocked]) {
-        // PDFView has the annoying habit for the password view to force a 
full window display
-        CGFloat leftWidth = [self leftSideWidth];
-        CGFloat rightWidth = [self rightSideWidth];
-        [self applyLeftSideWidth:0.0 rightSideWidth:0.0];
-        [pdfContentView addSubview:pdfView];
-        [pdfView activateConstraintsToSuperview];
-        [self applyLeftSideWidth:leftWidth rightSideWidth:rightWidth];
-    } else {
-        [pdfContentView addSubview:pdfView];
-        [pdfView activateConstraintsToSuperview];
-    }
+    [pdfContentView addSubview:pdfView];
+    [pdfView activateConstraintsToSuperview];
     
     // get the initial display mode from the PDF if present and not overridden 
by an explicit setup
     if (hasWindowSetup == NO && [[NSUserDefaults standardUserDefaults] 
boolForKey:SKUseSettingsFromPDFKey]) {
@@ -1194,13 +1184,7 @@
             [[pdfView document] setContainingDocument:nil];
         }
         
-        if ([document isLocked] && [pdfView window]) {
-            // PDFView has the annoying habit for the password view to force a 
full window display
-            CGFloat leftWidth = [self leftSideWidth];
-            CGFloat rightWidth = [self rightSideWidth];
-            [pdfView setDocument:document];
-            [self applyLeftSideWidth:leftWidth rightSideWidth:rightWidth];
-        } else {
+        if ([document isLocked] == NO) {
             NSArray *cropBoxes = [savedNormalSetup objectForKey:CROPBOXES_KEY];
             NSUInteger i, iMax = [document pageCount];
             if ([cropBoxes count] == iMax) {
@@ -1210,8 +1194,8 @@
                         [[document pageAtIndex:i] 
setBounds:NSRectFromString(box) forBox:kPDFDisplayBoxCropBox];
                 }
             }
-            [pdfView setDocument:document];
         }
+        [pdfView setDocument:document];
         [[pdfView document] setDelegate:self];
         
         [secondaryPdfView setDocument:document];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to