Revision: 15375 http://sourceforge.net/p/skim-app/code/15375 Author: hofman Date: 2025-06-05 16:09:30 +0000 (Thu, 05 Jun 2025) Log Message: ----------- only need to remove locked flag when not removing all
Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-06-05 15:58:49 UTC (rev 15374) +++ trunk/SKMainWindowController.m 2025-06-05 16:09:30 UTC (rev 15375) @@ -2069,6 +2069,8 @@ if ([self interactionMode] == SKNormalMode) [savedNormalSetup removeAllObjects]; + else + [savedNormalSetup removeObjectForKey:LOCKED_KEY]; // somehow the password field remains first responder after it has been removed if ([[[self window] firstResponder] isKindOfClass:[NSTextView class]] && [[(NSTextView *)[[self window] firstResponder] delegate] isKindOfClass:[NSSecureTextField class]] ) @@ -2076,6 +2078,8 @@ } - (void)documentDidUnlock:(NSNotification *)notification { + BOOL wasLocked = [[savedNormalSetup objectForKey:LOCKED_KEY] boolValue]; + if (placeholderPdfDocument && [[self pdfDocument] allowsNotes]) { PDFDocument *pdfDoc = [self pdfDocument]; NSMutableIndexSet *pageIndexes = [NSMutableIndexSet indexSet]; @@ -2091,7 +2095,7 @@ placeholderPdfDocument = nil; [pdfView setNeedsDisplay:YES]; [rightSideController.noteArrayController rearrangeObjects]; - if ([[savedNormalSetup objectForKey:LOCKED_KEY] boolValue] == NO) { + if (wasLocked == NO) { [rightSideController.noteOutlineView reloadData]; [self updateThumbnailsAtPageIndexes:pageIndexes]; } @@ -2106,11 +2110,9 @@ placeholderWidgetProperties = nil; } - if ([[savedNormalSetup objectForKey:LOCKED_KEY] boolValue]) { + if (wasLocked) { [self updatePageLabelsAndOutlineForExpansionState:nil]; - [savedNormalSetup removeObjectForKey:LOCKED_KEY]; - // when the PDF was locked, PDFView resets the display settings, so we need to reapply them, however if we don't delay it's reset again immediately [self performSelector:@selector(documentDidUnlockDelayed) withObject:nil afterDelay:0.0]; } 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