Revision: 16558
          http://sourceforge.net/p/skim-app/code/16558
Author:   hofman
Date:     2026-09-28 16:48:46 +0000 (Mon, 28 Sep 2026)
Log Message:
-----------
Don't use ivars to store note annotation string and drawsImage, unless 
developing for 10.11-

Modified Paths:
--------------
    trunk/SkimNotes/PDFAnnotation_SKNExtensions.h
    trunk/SkimNotes/PDFAnnotation_SKNExtensions.m

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.h
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.h       2026-09-28 09:13:46 UTC 
(rev 16557)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.h       2026-09-28 16:48:46 UTC 
(rev 16558)
@@ -517,11 +517,13 @@
 @interface SKNPDFAnnotationNote : PDFAnnotation
 #endif
 {
-    NSString *_string;
     PDFKitPlatformImage *_image;
     NSAttributedString *_text;
+#ifndef PDFKIT_PLATFORM_IOS
+#if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MIN_REQUIRED < 
MAC_OS_X_VERSION_10_12
+    NSString *_string;
     BOOL _drawsImage;
-#ifndef PDFKIT_PLATFORM_IOS
+#endif
     NSTextStorage *_textStorage;
     NSArray *_texts;
 #endif

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2026-09-28 09:13:46 UTC 
(rev 16557)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2026-09-28 16:48:46 UTC 
(rev 16558)
@@ -1642,7 +1642,7 @@
 
 @synthesize text = _text;
 @synthesize image = _image;
-@synthesize drawsImage = _drawsImage;
+@dynamic drawsImage;
 #ifndef PDFKIT_PLATFORM_IOS
 @dynamic mutableText;
 @synthesize texts = _texts;
@@ -1650,8 +1650,9 @@
 
 - (void)updateContents {
     NSMutableString *contents = [NSMutableString string];
-    if ([_string length])
-        [contents appendString:_string];
+    NSString *string = [self string];
+    if ([string length])
+        [contents appendString:string];
     if ([_text length]) {
         [contents appendString:@"  "];
         [contents appendString:[_text string]];
@@ -1711,22 +1712,41 @@
     return SKNNoteString;
 }
 
+- (BOOL)drawsImage {
+#if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MIN_REQUIRED < 
MAC_OS_X_VERSION_10_12
+    return _drawsImage;
+#else
+    return [[self valueForAnnotationKey:@"/SubType"] 
isEqualToString:@"/Stamp"];
+#endif
+}
+
 - (void)setDrawsImage:(BOOL)drawsImage {
+#if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MIN_REQUIRED < 
MAC_OS_X_VERSION_10_12
     _drawsImage = drawsImage;
     if ([self respondsToSelector:@selector(setValue:forAnnotationKey:)])
-        [self setValue:drawsImage ? @"/Stamp" : @"/Text" 
forAnnotationKey:@"/Subtype"];
+#endif
+    [self setValue:drawsImage ? @"/Stamp" : @"/Text" 
forAnnotationKey:@"/Subtype"];
 }
 
 - (NSString *)string {
+#if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MIN_REQUIRED < 
MAC_OS_X_VERSION_10_12
     return _string;
+#else
+    return [self valueForAnnotationKey:@"/SkimComment"];
+#endif
 }
 
 - (void)setString:(NSString *)string {
-    if (_string != string) {
-        _string = [string copy];
-        // update the contents to string + text
-        [self updateContents];
-    }
+#if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MIN_REQUIRED < 
MAC_OS_X_VERSION_10_12
+    _string = [string copy];
+#else
+    if (string)
+        [self setValue:[string copy] forAnnotationKey:@"/SkimComment"];
+    else
+        [self removeValueForAnnotationKey:@"/SkimComment"];
+#endif
+    // update the contents to string + text
+    [self updateContents];
 }
 
 #ifdef PDFKIT_PLATFORM_IOS

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

Reply via email to