Parcourir la source

【注释】Form 文本域创建方法统一

wanjun il y a 10 mois
Parent
commit
798f9f9d59

+ 1 - 21
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -3586,27 +3586,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
         }
             break;
         case CAnnotationTypeTextField:{
-            KMPDFAnnotationTextWidgetSub *textWidget = [[KMPDFAnnotationTextWidgetSub alloc] initWithDocument:self.document];
-            textWidget.stringValue = NSLocalizedString(@"", nil);
-            CPDFBorder *border = [[CPDFBorder alloc] initWithStyle:CPDFBorderStyleSolid lineWidth:0 dashPattern:nil];
-            textWidget.border = border;
-            NSColor* backgroundColor = [sud colorForKey:@"SKAnnotationTextWidgetBackgroundColorKey"];
-            if (backgroundColor) {
-                [(CPDFWidgetAnnotation *)textWidget setBackgroundColor:backgroundColor];
-            } else {
-                [(CPDFWidgetAnnotation *)textWidget setBackgroundColor:[NSColor grayColor]];
-            }
-            
-            NSColor* fontColor = [sud colorForKey:@"SKAnnotationTextWidgetFontColorKey"];
-            if (fontColor) {
-                [(CPDFWidgetAnnotation *)textWidget setFontColor:fontColor];
-            }
-            textWidget.alignment = [sud integerForKey:@"SKAnnotationTextWidgetAlignmenKey"];
-            NSFont *font = [sud fontForNameKey:@"SKAnnotationTextWidgetFontNameKey" sizeKey:@"SKAnnotationTextWidgetFontSizeKey"];
-            if (font) {
-                [(CPDFWidgetAnnotation *)textWidget setFont:font];
-            }
-            textWidget.isMultiline = [sud boolForKey:@"SKAnnotationTextMultilineKey"];
+            CPDFTextWidgetAnnotation *textWidget = [[CPDFTextWidgetAnnotation alloc] initWithKMNoteBounds:bounds document:self.document];
             newAnnotation = textWidget;
         }
             break;