Revision: 13628
http://sourceforge.net/p/skim-app/code/13628
Author: hofman
Date: 2023-09-03 08:36:21 +0000 (Sun, 03 Sep 2023)
Log Message:
-----------
use local variables for pdf document
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2023-09-03 08:31:03 UTC (rev 13627)
+++ trunk/SKMainWindowController.m 2023-09-03 08:36:21 UTC (rev 13628)
@@ -1149,14 +1149,15 @@
BOOL rotated = NO, secondaryRotated = NO;
NSArray *snapshotDicts = nil;
NSDictionary *openState = nil;
+ PDFDocument *oldPdfDoc = [pdfView document];
- if ([pdfView document]) {
+ if (oldPdfDoc) {
pageIndex = [pdfView currentPageIndexAndPoint:&point
rotated:&rotated];
if (secondaryPdfView)
secondaryPageIndex = [secondaryPdfView
currentPageIndexAndPoint:&secondaryPoint rotated:&secondaryRotated];
openState = [self expansionStateForOutline:[[pdfView document]
outlineRoot]];
- [[pdfView document] cancelFindString];
+ [oldPdfDoc cancelFindString];
// make sure these will not be activated, or they can lead to a
crash
[pdfView removePDFToolTipRects];
@@ -1180,11 +1181,11 @@
[self unregisterForDocumentNotifications];
- [[pdfView document] setDelegate:nil];
+ [oldPdfDoc setDelegate:nil];
- [[[pdfView document] outlineRoot] clearDocument];
+ [[oldPdfDoc outlineRoot] clearDocument];
- [[pdfView document] setContainingDocument:nil];
+ [oldPdfDoc setContainingDocument:nil];
}
if ([document isLocked] == NO) {
@@ -1198,7 +1199,7 @@
[secondaryPdfView setDocument:document];
- [[pdfView document] setContainingDocument:[self document]];
+ [document setContainingDocument:[self document]];
[self registerForDocumentNotifications];
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