Revision: 16578
          http://sourceforge.net/p/skim-app/code/16578
Author:   hofman
Date:     2026-09-30 15:53:20 +0000 (Wed, 30 Sep 2026)
Log Message:
-----------
combine fdf generation for widgets

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

Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m  2026-09-30 15:43:12 UTC (rev 16577)
+++ trunk/PDFAnnotation_SKExtensions.m  2026-09-30 15:53:20 UTC (rev 16578)
@@ -512,26 +512,14 @@
         [fdfString 
appendFDFName:SKFDFTextAnnotationIconTypeFromPDFTextAnnotationIconType([self 
iconType])];
     } else if ([type isEqualToString:SKNWidgetString]) {
         NSString *ft = [self widgetFieldType];
-        if ([ft isEqualToString:PDFAnnotationWidgetSubtypeText]) {
-            [fdfString appendFDFName:SKFDFAnnotationFieldTypeKey];
-            [fdfString appendFDFName:SKFDFFieldTypeText];
-            [fdfString appendFDFName:SKFDFAnnotationFieldNameKey];
-            [fdfString appendFormat:@"(%@)", [[[self fieldName] ?: @"" 
lossyStringUsingEncoding:NSISOLatin1StringEncoding] 
stringByEscapingParenthesis]];
-            [fdfString appendFDFName:SKFDFAnnotationFieldValueKey];
-            [fdfString appendFormat:@"(%@)", [[[self widgetStringValue] ?: @"" 
lossyStringUsingEncoding:NSISOLatin1StringEncoding] 
stringByEscapingParenthesis]];
-        } else if ([ft isEqualToString:PDFAnnotationWidgetSubtypeButton]) {
-            [fdfString appendFDFName:SKFDFAnnotationFieldTypeKey];
-            [fdfString appendFDFName:SKFDFFieldTypeButton];
-            [fdfString appendFDFName:SKFDFAnnotationFieldNameKey];
-            [fdfString appendFormat:@"(%@)", [[[self fieldName] ?: @"" 
lossyStringUsingEncoding:NSISOLatin1StringEncoding] 
stringByEscapingParenthesis]];
-            [fdfString appendFDFName:SKFDFAnnotationFieldValueKey];
+        [fdfString appendFDFName:SKFDFAnnotationFieldTypeKey];
+        [fdfString appendString:ft];
+        [fdfString appendFDFName:SKFDFAnnotationFieldNameKey];
+        [fdfString appendFormat:@"(%@)", [[[self fieldName] ?: @"" 
lossyStringUsingEncoding:NSISOLatin1StringEncoding] 
stringByEscapingParenthesis]];
+        [fdfString appendFDFName:SKFDFAnnotationFieldValueKey];
+        if ([ft isEqualToString:PDFAnnotationWidgetSubtypeButton]) {
             [fdfString appendFormat:@"/%@", [self buttonWidgetState] == 
kPDFWidgetOnState ? [self buttonWidgetStateString] : @"Off"];
-        } else if ([ft isEqualToString:PDFAnnotationWidgetSubtypeChoice]) {
-            [fdfString appendFDFName:SKFDFAnnotationFieldTypeKey];
-            [fdfString appendFDFName:SKFDFFieldTypeChoice];
-            [fdfString appendFDFName:SKFDFAnnotationFieldNameKey];
-            [fdfString appendFormat:@"(%@)", [[[self fieldName] ?: @"" 
lossyStringUsingEncoding:NSISOLatin1StringEncoding] 
stringByEscapingParenthesis]];
-            [fdfString appendFDFName:SKFDFAnnotationFieldValueKey];
+        } else {
             [fdfString appendFormat:@"(%@)", [[[self widgetStringValue] ?: @"" 
lossyStringUsingEncoding:NSISOLatin1StringEncoding] 
stringByEscapingParenthesis]];
         }
         

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