Revision: 15401
          http://sourceforge.net/p/skim-app/code/15401
Author:   hofman
Date:     2025-06-07 21:36:23 +0000 (Sat, 07 Jun 2025)
Log Message:
-----------
get pageindex from page

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2025-06-07 21:25:14 UTC (rev 15400)
+++ trunk/SKMainWindowController.m      2025-06-07 21:36:23 UTC (rev 15401)
@@ -976,10 +976,11 @@
     
     if ([notesToRemove count]) {
         for (PDFAnnotation *annotation in notesToRemove) {
-            [removedNotesAndPages addObject:@[annotation, [annotation page]]];
+            PDFPage *page = [annotation page];
+            [removedNotesAndPages addObject:@[annotation, page]];
             if (removedIndexes)
-                [removedIndexes addIndex:[notes indexOfObject:annotation]];
-            [pageIndexes addIndex:[annotation pageIndex]];
+                [removedIndexes addIndex:[notes 
indexOfObjectIdenticalTo:annotation]];
+            [pageIndexes addIndex:[page pageIndex]];
             [pdfDoc removeAnnotation:annotation];
         }
     }
@@ -988,11 +989,12 @@
         BOOL shouldDisplay = [pdfView hideNotes] == NO;
         for (NSArray *annotationAndPage in notesAndPagesToAdd) {
             PDFAnnotation *annotation = [annotationAndPage firstObject];
+            PDFPage *page = [annotationAndPage lastObject];
             [annotation setShouldDisplay:shouldDisplay];
             [annotation setShouldPrint:shouldDisplay];
             [addedNotes addObject:annotation];
-            [pageIndexes addIndex:[annotation pageIndex]];
-            [pdfDoc addAnnotation:annotation toPage:[annotationAndPage 
lastObject]];
+            [pageIndexes addIndex:[page pageIndex]];
+            [pdfDoc addAnnotation:annotation toPage:page];
         }
     }
 

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