Revision: 16507
http://sourceforge.net/p/skim-app/code/16507
Author: hofman
Date: 2026-09-20 14:41:44 +0000 (Sun, 20 Sep 2026)
Log Message:
-----------
save markup contents in annotation dictionary
Modified Paths:
--------------
trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m 2026-09-20 10:46:21 UTC
(rev 16506)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m 2026-09-20 14:41:44 UTC
(rev 16507)
@@ -945,8 +945,6 @@
objc_setAssociatedObject(self, &SKNIsSkimNoteKey, flag ? [NSNumber
numberWithBool:YES] : nil, OBJC_ASSOCIATION_RETAIN);
}
-static char SKNStringKey;
-
- (NSString *)string {
#if defined(PDFKIT_PLATFORM_IOS) || (defined(MAC_OS_X_VERSION_10_13) &&
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_13)
if (@available(macOS 27.0, iOS 27.0, *)) {
@@ -954,7 +952,7 @@
if (markupTypes == nil)
markupTypes = [[NSSet alloc] initWithObjects:SKNHighlightString,
SKNUnderlineString, SKNStrikeOutString, SKNMarkUpString, SKNSquigglyString,
nil];
if ([markupTypes containsObject:[self type]]) {
- return objc_getAssociatedObject(self, &SKNStringKey);
+ return [self valueForAnnotationKey:@"/SkimContents"] ?: [self
contents];
}
}
#endif
@@ -988,7 +986,7 @@
if (markupTypes == nil)
markupTypes = [[NSSet alloc] initWithObjects:SKNHighlightString,
SKNUnderlineString, SKNStrikeOutString, SKNMarkUpString, SKNSquigglyString,
nil];
if ([markupTypes containsObject:[self type]]) {
- objc_setAssociatedObject(self, &SKNStringKey, string,
OBJC_ASSOCIATION_RETAIN);
+ [self setValue:string forAnnotationKey:@"/SkimContents"];
return;
}
}
@@ -1420,7 +1418,7 @@
- (NSString *)string {
#if defined(MAC_OS_X_VERSION_10_13) && MAC_OS_X_VERSION_MAX_ALLOWED >=
MAC_OS_X_VERSION_10_13
if (@available(macOS 27.0, iOS 27.0, *))
- return objc_getAssociatedObject(self, &SKNStringKey);
+ return [self valueForAnnotationKey:@"/SkimContents"] ?: [self
contents];
else
#endif
return [self contents];
@@ -1429,7 +1427,7 @@
- (void)setString:(NSString *)string {
#if defined(MAC_OS_X_VERSION_10_13) && MAC_OS_X_VERSION_MAX_ALLOWED >=
MAC_OS_X_VERSION_10_13
if (@available(macOS 27.0, iOS 27.0, *))
- objc_setAssociatedObject(self, &SKNStringKey, string,
OBJC_ASSOCIATION_RETAIN);
+ [self setValue:string forAnnotationKey:@"/SkimContents"];
else
#endif
[self setContents: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