Browse Source

【2025】 【BOTA】搜索列表,搜索关键词后,切换到搜索替换模式再回来搜索后,点击工具栏容易崩溃 - 修复

lizhe 1 tháng trước cách đây
mục cha
commit
829ac09155

+ 4 - 2
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -6694,8 +6694,10 @@ extension KMMainViewController: KMNLeftSideViewControllerDelegate {
     func searchTypeDidChange(controller: KMNLeftSideViewController) {
         let handdler = controller.searchViewC.handdler
         if handdler.type == .replace {
-            viewManager.toolMode = .Edit
-            updatePDFViewAnnotationMode()
+            if viewManager.toolMode != .Edit {
+                viewManager.toolMode = .Edit
+                updatePDFViewAnnotationMode()
+            }
         }
     }
 }

+ 3 - 0
PDF Office/PDF Master/KMClass/Left/Search/Controller/KMBotaSearchViewController.swift

@@ -352,6 +352,9 @@ class KMBotaSearchViewController: KMNBotaBaseViewController {
             }
             self.finding_ = true
             let searchS = keyword
+            if searchS.isEmpty {
+                return
+            }
             let opt = self.fetchSearchOptions()
             DispatchQueue.global().async {
                 let datas = self.handdler.pdfView?.document.findEditAllPageString(searchS, with: opt) ?? []