Browse Source

【fix】【注释列表】注释列表为空,搜索和筛选Icon要置灰。bug修复

tangchao 10 months ago
parent
commit
486814f9ea

+ 11 - 12
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift

@@ -788,16 +788,18 @@ extension KMLeftSideViewController {
                 }
                 //添加签名注释
                 for annotation in page?.annotations ?? [] {
-                   if annotation.isKind(of: CPDFSignatureAnnotation.self) {
-                       annos.append(annotation)
-                   } 
+                    if annotation.isKind(of: CPDFSignatureAnnotation.self) {
+                        annos.append(annotation)
+                    }
                 }
                 for annotation in annos {
-//                    if annotation.isKind(of: KMTableAnnotation.self) {
-//                        annos.removeObject(annotation)
-//                    } else
+                    //                    if annotation.isKind(of: KMTableAnnotation.self) {
+                    //                        annos.removeObject(annotation)
+                    //                    } else
                     if annotation.annotationShouldDisplay() == false {
                         annos.removeObject(annotation)
+                    } else if annotation.isKind(of: CPDFLinkAnnotation.self) {
+                        annos.removeObject(annotation)
                     }
                 }
                 
@@ -805,7 +807,8 @@ extension KMLeftSideViewController {
                 allAnnotation += annos
                 
                 //添加所有annotation 用于筛选
-                annotationArray += (page?.annotations ?? [])
+//                annotationArray += (page?.annotations ?? [])
+                annotationArray += annos
             }
             
             //  处理排序
@@ -864,11 +867,7 @@ extension KMLeftSideViewController {
             
             // 转换对象,用于数据显示
             self.allAnnotations = annotationArray
-//            if self.annotations.count < 1 {
-//               self.filtrateButton.isEnabled = false
-//            } else {
-//               self.filtrateButton.isEnabled = true
-//            }
+            self.noteFilterButton.isEnabled = self.allAnnotations.count >= 1
         }
         self.note_refrshUIIfNeed()
     }