Revision: 14624
          http://sourceforge.net/p/skim-app/code/14624
Author:   hofman
Date:     2024-11-01 23:28:34 +0000 (Fri, 01 Nov 2024)
Log Message:
-----------
no need for drawsImage ivar on iOS, keep it om macOS to support old OS versions 
in code

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

Modified: trunk/SkimNotes/SKNPDFAnnotationNote.h
===================================================================
--- trunk/SkimNotes/SKNPDFAnnotationNote.h      2024-11-01 22:55:01 UTC (rev 
14623)
+++ trunk/SkimNotes/SKNPDFAnnotationNote.h      2024-11-01 23:28:34 UTC (rev 
14624)
@@ -86,9 +86,9 @@
 {
     NSString *_string;
     PDFKitPlatformImage *_image;
-    BOOL _drawsImage;
     NSAttributedString *_text;
 #if !defined(PDFKIT_PLATFORM_IOS)
+    BOOL _drawsImage;
     NSTextStorage *_textStorage;
     NSArray *_texts;
 #endif

Modified: trunk/SkimNotes/SKNPDFAnnotationNote.m
===================================================================
--- trunk/SkimNotes/SKNPDFAnnotationNote.m      2024-11-01 22:55:01 UTC (rev 
14623)
+++ trunk/SkimNotes/SKNPDFAnnotationNote.m      2024-11-01 23:28:34 UTC (rev 
14624)
@@ -83,8 +83,10 @@
 @synthesize string = _string;
 @synthesize text = _text;
 @synthesize image = _image;
+#if defined(PDFKIT_PLATFORM_IOS)
+@dynamic drawsImage;
+#else
 @synthesize drawsImage = _drawsImage;
-#if !defined(PDFKIT_PLATFORM_IOS)
 @dynamic mutableText;
 @synthesize texts = _texts;
 #endif
@@ -114,11 +116,9 @@
         if ([aName isKindOfClass:stringClass] && [self 
respondsToSelector:@selector(setValue:forAnnotationKey:)])
             [self setValue:aName forAnnotationKey:@"/Name"];
         if ([drawImage respondsToSelector:@selector(boolValue)])
-            _drawsImage = [drawImage boolValue];
+            [self setDrawsImage:[drawImage boolValue]];
         else
-            _drawsImage = [[dict objectForKey:SKNPDFAnnotationTypeKey] 
isEqualToString:SKNStampString];
-        if ([self respondsToSelector:@selector(setValue:forAnnotationKey:)])
-            [self setValue:_drawsImage ? @"/Stamp" : @"/Text" 
forAnnotationKey:@"/Subtype"];
+            [self setDrawsImage:[[dict objectForKey:SKNPDFAnnotationTypeKey] 
isEqualToString:SKNStampString]];
         if ([anImage isKindOfClass:imageClass])
             _image = anImage;
         else if ([anImage isKindOfClass:dataClass])
@@ -154,12 +154,18 @@
     return SKNNoteString;
 }
 
+#if defined(PDFKIT_PLATFORM_IOS)
+- (BOOL)drawsImage {
+    return [[self valueForAnnotationKey:@"/Subtype"] 
isEqualToString:@"/Stamp"];
+}
+#endif
+
 - (void)setDrawsImage:(BOOL)drawsImage {
-    if (drawsImage != _drawsImage) {
-        _drawsImage = drawsImage;
-        if ([self respondsToSelector:@selector(setValue:forAnnotationKey:)])
-            [self setValue:_drawsImage ? @"/Stamp" : @"/Text" 
forAnnotationKey:@"/Subtype"];
-    }
+#if !defined(PDFKIT_PLATFORM_IOS)
+    _drawsImage = drawsImage;
+    if ([self respondsToSelector:@selector(setValue:forAnnotationKey:)])
+#endif
+    [self setValue:drawsImage ? @"/Stamp" : @"/Text" 
forAnnotationKey:@"/Subtype"];
 }
 
 - (void)setString:(NSString *)string {

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