Revision: 16552
          http://sourceforge.net/p/skim-app/code/16552
Author:   hofman
Date:     2026-09-27 16:08:25 +0000 (Sun, 27 Sep 2026)
Log Message:
-----------
use self as class

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

Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m  2026-09-27 15:45:41 UTC (rev 16551)
+++ trunk/PDFAnnotation_SKExtensions.m  2026-09-27 16:08:25 UTC (rev 16552)
@@ -223,19 +223,19 @@
     return nil;
 }
 
-static inline Class SKAnnotationClassForType(NSString *type) {
++ (Class)annotationClassForType:(NSString *)type {
     if ([type isEqualToString:SKNNoteString] || [type 
isEqualToString:SKNTextString] || [type isEqualToString:SKNStampString])
         return [SKNPDFAnnotationNote class];
     else
-        return [PDFAnnotation class];
+        return self;
 }
 
 + (PDFAnnotation *)newSkimNoteWithBounds:(NSRect)bounds forType:(NSString 
*)type {
-    return [[SKAnnotationClassForType(type) alloc] 
initSkimNoteWithBounds:bounds forType:type];
+    return [[[self annotationClassForType:type] alloc] 
initSkimNoteWithBounds:bounds forType:type];
 }
 
 + (PDFAnnotation *)newSkimNoteWithProperties:(NSDictionary *)dict {
-    PDFAnnotation *annotation = [[SKAnnotationClassForType([dict 
objectForKey:SKNPDFAnnotationTypeKey]) alloc] initSkimNoteWithProperties:dict];
+    PDFAnnotation *annotation = [[[self annotationClassForType:[dict 
objectForKey:SKNPDFAnnotationTypeKey]] alloc] initSkimNoteWithProperties:dict];
     if ([annotation isMarkup]) {
         // generate the lineRects now, for thread safety
         NSPointerArray *lines = lineRectsForQuadPoints([annotation 
quadrilateralPoints], [annotation bounds].origin);
@@ -261,7 +261,7 @@
     if (lines == nil)
         return nil;
     
-    PDFAnnotation *annotation = [[PDFAnnotation alloc] 
initSkimNoteWithBounds:bounds forType:type];
+    PDFAnnotation *annotation = [[self alloc] initSkimNoteWithBounds:bounds 
forType:type];
     
     if (annotation) {
         NSArray *quadPoints = quadPointsForLineRects(lines, bounds.origin, 
[page lineDirectionAngle] / 90);
@@ -281,7 +281,7 @@
     bounds = NSInsetRect(NSIntegralRect(bounds), -8.0, -8.0);
     [transform translateXBy:-NSMinX(bounds) yBy:-NSMinY(bounds)];
     
-    PDFAnnotation *annotation = [[PDFAnnotation alloc] 
initSkimNoteWithBounds:bounds forType:SKNInkString];
+    PDFAnnotation *annotation = [[self alloc] initSkimNoteWithBounds:bounds 
forType:SKNInkString];
     
     for (NSBezierPath *path in paths)
         [annotation addBezierPath:[transform transformBezierPath:path]];

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