Revision: 14999
          http://sourceforge.net/p/skim-app/code/14999
Author:   hofman
Date:     2025-03-21 18:26:04 +0000 (Fri, 21 Mar 2025)
Log Message:
-----------
make page for new markup Skim note nonnull, pass safeFirstPage already in 
initializer

Modified Paths:
--------------
    trunk/PDFAnnotationMarkup_SKExtensions.h
    trunk/PDFAnnotationMarkup_SKExtensions.m
    trunk/PDFAnnotation_SKExtensions.m

Modified: trunk/PDFAnnotationMarkup_SKExtensions.h
===================================================================
--- trunk/PDFAnnotationMarkup_SKExtensions.h    2025-03-21 17:54:14 UTC (rev 
14998)
+++ trunk/PDFAnnotationMarkup_SKExtensions.h    2025-03-21 18:26:04 UTC (rev 
14999)
@@ -45,7 +45,7 @@
 
 @interface PDFAnnotationMarkup (SKExtensions)
 
-- (nullable instancetype)initSkimNoteWithSelection:(PDFSelection *)selection 
forPage:(nullable PDFPage *)page forType:(NSString *)type;
+- (nullable instancetype)initSkimNoteWithSelection:(PDFSelection *)selection 
forPage:(PDFPage *)page forType:(NSString *)type;
 
 @property (nonatomic, nullable, readonly) PDFSelection *selection;
 

Modified: trunk/PDFAnnotationMarkup_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationMarkup_SKExtensions.m    2025-03-21 17:54:14 UTC (rev 
14998)
+++ trunk/PDFAnnotationMarkup_SKExtensions.m    2025-03-21 18:26:04 UTC (rev 
14999)
@@ -117,8 +117,6 @@
 }
 
 - (instancetype)initSkimNoteWithSelection:(PDFSelection *)selection 
forPage:(PDFPage *)page forType:(NSString *)type {
-    if (page == nil)
-        page = [selection safeFirstPage];
     NSRect bounds = NSZeroRect;
     NSPointerArray *lines = nil;
     if ([selection hasCharacters]) {

Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m  2025-03-21 17:54:14 UTC (rev 14998)
+++ trunk/PDFAnnotation_SKExtensions.m  2025-03-21 18:26:04 UTC (rev 14999)
@@ -143,9 +143,12 @@
 }
 
 + (PDFAnnotation *)newSkimNoteWithSelection:(PDFSelection *)selection 
forType:(NSString *)type {
+    PDFPage *page = [selection safeFirstPage];
+    if (page == nil)
+        return nil;
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    return [[PDFAnnotationMarkup alloc] initSkimNoteWithSelection:selection 
forPage:nil forType:type];
+    return [[PDFAnnotationMarkup alloc] initSkimNoteWithSelection:selection 
forPage:page forType:type];
 #pragma clang diagnostic pop
 }
 

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