Revision: 15453
http://sourceforge.net/p/skim-app/code/15453
Author: hofman
Date: 2025-06-13 09:14:36 +0000 (Fri, 13 Jun 2025)
Log Message:
-----------
invalidate marked page only on revert. Check for pageCount early.
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-06-13 08:42:56 UTC (rev 15452)
+++ trunk/SKMainWindowController.m 2025-06-13 09:14:36 UTC (rev 15453)
@@ -1086,16 +1086,23 @@
if (oldPdfDoc) {
// this is a revert
// need to clean up data and actions, and remember settings to restore
- dest = [pdfView currentDestination:YES];
- if (dest.pageIndex >= pageCount && dest.pageIndex != NSNotFound)
- dest = (SKDestination){pageCount - 1, SKUnspecifiedPoint};
- if (secondaryPdfView) {
- secondaryDest = [secondaryPdfView currentDestination:YES];
- if (secondaryDest.pageIndex >= pageCount &&
secondaryDest.pageIndex != NSNotFound)
- secondaryDest = (SKDestination){pageCount - 1,
SKUnspecifiedPoint};
+ if (pageCount) {
+ dest = [pdfView currentDestination:YES];
+ if (dest.pageIndex >= pageCount && dest.pageIndex != NSNotFound)
+ dest = (SKDestination){pageCount - 1, SKUnspecifiedPoint};
+ if (secondaryPdfView) {
+ secondaryDest = [secondaryPdfView currentDestination:YES];
+ if (secondaryDest.pageIndex >= pageCount &&
secondaryDest.pageIndex != NSNotFound)
+ secondaryDest = (SKDestination){pageCount - 1,
SKUnspecifiedPoint};
+ }
}
openState = [self expansionStateForOutline:[[pdfView document]
outlineRoot]];
+ if (markedPage.pageIndex >= pageCount)
+ markedPage.pageIndex = beforeMarkedPage.pageIndex = NSNotFound;
+ else if (beforeMarkedPage.pageIndex >= pageCount)
+ beforeMarkedPage.pageIndex = NSNotFound;
+
[oldPdfDoc cancelFindString];
// make sure these will not be activated, or they can lead to a crash
@@ -1199,17 +1206,12 @@
else if ([widgetProperties count])
placeholderWidgetProperties = [widgetProperties copy];
- if (markedPage.pageIndex >= pageCount)
- markedPage.pageIndex = beforeMarkedPage.pageIndex = NSNotFound;
- else if (beforeMarkedPage.pageIndex >= pageCount)
- beforeMarkedPage.pageIndex = NSNotFound;
-
[self updatePageLabelsAndOutlineForExpansionState:openState];
if (unlocked && [snapshotDicts count])
[self showSnapshotsWithSetups:snapshotDicts];
- if (unlocked && pageCount && dest.pageIndex != NSNotFound) {
+ if (unlocked && 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit