Browse Source

【综合】
1、重复删除水印Crash修正
2、注释列表未及时删除空文本注释处理
3、标记注释清空内容后显示错误修正

niehaoyu 8 months ago
parent
commit
33d037c44a

+ 3 - 0
PDF Office/PDF Master/Class/PDFTools/Watermark/Tools/KMWatermarkAdjectiveTools.swift

@@ -183,6 +183,9 @@ case bates = 4
                 let property = document.background()
                 property?.clear()
             } else if (type == .watermark) {
+                guard let tempArr = document.watermarks() else {
+                    return
+                }
                 let array: Array<CPDFWatermark> = document.watermarks()
                 for model in array {
                     document.removeWatermark(model)

+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFAnnotationExtensions/CPDFMarkupAnnotation+PDFListView.swift

@@ -200,6 +200,7 @@ class CPDFAnnotationMarkupExtraIvars: NSObject {
     
     func markupContent() -> String {
         var contextString: String? = self.markupText()
+        return contextString ?? ""
         if contextString == nil || contextString?.isEmpty == true {
             contextString = self.contents
         }

+ 3 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -55,6 +55,9 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
         if ([self isEditWithCurrentFreeText:(CPDFFreeTextAnnotation *)self.activeAnnotation]) {
             CRectEdges resizeHandle = [self.activeAnnotation resizeHandleForPoint:point scaleFactor:[self scaleFactor]];
             if (isCustomStampPDFView == NO) {
+                if (self.activeAnnotation.contents.length == 0) {
+                    [self removeAnnotation:self.activeAnnotation];
+                }
                 if (CNoEdgeMask == resizeHandle) {
                     [super mouseDown:theEvent];
                     [self updateActiveAnnotations:@[]];