Przeglądaj źródła

【BOTA】多个section注释删除后卡死 修复

lizhe 1 rok temu
rodzic
commit
1233da152a

+ 6 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/KMAnnotationView/KMAnnotationOutlineView.swift

@@ -101,10 +101,13 @@ extension KMAnnotationOutlineView : NSOutlineViewDataSource,NSOutlineViewDelegat
         } else if item is KMBOTAAnnotationItem {
         } else if item is KMBOTAAnnotationItem {
             return item as Any
             return item as Any
         } else {
         } else {
-            var section = self.data[index]
-            while section.annotations?.count == 0 {
-                section = self.data[index + 1]
+            var tempArray: [KMBOTAAnnotationSection] = []
+            for temp in self.data {
+                if temp.annotations?.count != 0 {
+                    tempArray.append(temp)
+                }
             }
             }
+            let section = tempArray[index]
             return section as Any
             return section as Any
         }
         }
     }
     }