Revision: 15431
http://sourceforge.net/p/skim-app/code/15431
Author: hofman
Date: 2025-06-11 09:06:09 +0000 (Wed, 11 Jun 2025)
Log Message:
-----------
create placeholder pdf document only later when adding notes
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-06-11 08:44:44 UTC (rev 15430)
+++ trunk/SKMainWindowController.m 2025-06-11 09:06:09 UTC (rev 15431)
@@ -1071,7 +1071,6 @@
}
- (void)setPdfDocument:(PDFDocument *)pdfDocument
addAnnotationsWithProperties:(NSArray *)noteDicts {
- PDFDocument *pdfDoc = pdfDocument;
NSMutableArray *widgetProperties = nil;
PDFDocument *oldPdfDoc = [pdfView document];
SKDestination dest = {NSNotFound, NSZeroPoint}, secondaryDest =
{NSNotFound, NSZeroPoint};
@@ -1080,16 +1079,6 @@
NSDictionary *openState = nil;
placeholderPdfDocument = nil;
- if ([pdfDoc allowsNotes] == NO && [noteDicts count] > 0) {
- // there should not be any notesToRemove at this point
- NSUInteger i, pageCount = MIN([pdfDoc pageCount], [[noteDicts
valueForKeyPath:@"@max.pageIndex"] unsignedIntegerValue] + 1);
- pdfDoc = placeholderPdfDocument = [[SKPDFDocument alloc] init];
- [placeholderPdfDocument setContainingDocument:[self document]];
- for (i = 0; i < pageCount; i++) {
- PDFPage *page = [[SKPDFPage alloc] init];
- [placeholderPdfDocument insertPage:page atIndex:i];
- }
- }
if (oldPdfDoc) {
// this is a revert
@@ -1146,7 +1135,17 @@
}
if ([noteDicts count]) {
+ PDFDocument *pdfDoc = pdfDocument;
+ if ([pdfDoc allowsNotes] == NO) {
+ NSUInteger i, pageCount = MIN([pdfDoc pageCount], [[noteDicts
valueForKeyPath:@"@max.pageIndex"] unsignedIntegerValue] + 1);
+ pdfDoc = placeholderPdfDocument = [[SKPDFDocument alloc] init];
+ [placeholderPdfDocument setContainingDocument:[self document]];
+ for (i = 0; i < pageCount; i++)
+ [placeholderPdfDocument insertPage:[[SKPDFPage alloc] init]
atIndex:i];
+ }
+
widgetProperties = [NSMutableArray array];
+
NSArray *notesAndPagesToAdd = [self
annotationsAndPagesWithProperties:noteDicts forDocument:pdfDoc autoUpdate:NO
widgetProperties:widgetProperties];
if ([notesAndPagesToAdd count]) {
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