Revision: 15447
          http://sourceforge.net/p/skim-app/code/15447
Author:   hofman
Date:     2025-06-12 14:24:12 +0000 (Thu, 12 Jun 2025)
Log Message:
-----------
invert flag

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2025-06-12 14:16:03 UTC (rev 15446)
+++ trunk/SKMainWindowController.m      2025-06-12 14:24:12 UTC (rev 15447)
@@ -1080,7 +1080,7 @@
     SKDestination dest = {NSNotFound, NSZeroPoint}, secondaryDest = 
{NSNotFound, NSZeroPoint};
     NSArray *snapshotDicts = nil;
     NSDictionary *openState = nil;
-    BOOL isLocked = [pdfDocument isLocked];
+    BOOL unlocked = NO == [pdfDocument isLocked];
     NSUInteger pageCount = [pdfDocument pageCount];
     
     if (oldPdfDoc) {
@@ -1125,9 +1125,11 @@
         
         [oldPdfDoc setContainingDocument:nil];
         
-        if (isLocked != [oldPdfDoc isLocked]) {
-            if (isLocked) {
-                if ([self interactionMode] == SKNormalMode)
+        if (unlocked == [oldPdfDoc isLocked]) {
+            if (unlocked) {
+                [self performSelector:@selector(documentDidUnlockDelayed) 
withObject:nil afterDelay:0.0];
+            } else {
+               if ([self interactionMode] == SKNormalMode)
                     [savedNormalSetup setDictionary:[pdfView displaySettings]];
                 [savedNormalSetup setObject:@YES forKey:LOCKED_KEY];
                 if (dest.pageIndex != NSNotFound)
@@ -1136,12 +1138,11 @@
                     [savedNormalSetup setObject:NSStringFromPoint(dest.point) 
forKey:SCROLLPOINT_KEY];
                 if ([snapshotDicts count])
                     [savedNormalSetup setObject:snapshotDicts 
forKey:SNAPSHOTS_KEY];
-            } else
-                [self performSelector:@selector(documentDidUnlockDelayed) 
withObject:nil afterDelay:0.0];
+            }
         }
     }
     
-    if (isLocked == NO) {
+    if (unlocked) {
         NSArray *cropBoxes = [savedNormalSetup objectForKey:CROPBOXES_KEY];
         if ([cropBoxes count])
             [self applyChangedCropBoxes:cropBoxes inDocument:pdfDocument];
@@ -1189,18 +1190,18 @@
     
     [toolbarController updateMinMaxScale];
     
-    if (isLocked)
-        placeholderWidgetProperties = [widgetProperties count] ? 
[widgetProperties copy] : nil;
-    else
+    if (unlocked)
         [self updateWidgetsWithProperties:widgetProperties reset:NO];
+    else if ([widgetProperties count])
+        placeholderWidgetProperties = [widgetProperties copy];
     
     [self updatePageLabelsAndOutlineForExpansionState:openState];
     [self updateNoteSelection];
     
-    if (isLocked == NO && [snapshotDicts count])
+    if (unlocked && [snapshotDicts count])
         [self showSnapshotsWithSetups:snapshotDicts];
     
-    if (isLocked == NO && pageCount && dest.pageIndex != NSNotFound) {
+    if (unlocked && pageCount && dest.pageIndex != NSNotFound) {
         [pdfView goToCurrentDestination:dest];
         if (secondaryDest.pageIndex != NSNotFound)
             [secondaryPdfView goToCurrentDestination:secondaryDest];

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



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to