Browse Source

【fix】【内容编辑】复制文本块,粘贴为空,再次粘贴崩溃(必现)

tangchao 6 months ago
parent
commit
05ef6af336

+ 6 - 0
PDF Office/PDF Master/Class/PDFTools/EditPDF/Window/KMEditPDFPopToolBarWindow.swift

@@ -115,6 +115,12 @@ import Cocoa
                     
                     width = 392
                     contentViewC?.itemKeys = [.color, .fontStyle, .fontAdd, .fontReduce, .fontBold, .fontItalic, .textAlignment]
+                    let keyCnt = contentViewC?.itemKeys.count ?? 0
+                    let dataCnt = contentViewC?.datas.count ?? 0
+                    if dataCnt == 0 || dataCnt != keyCnt {
+                        needUpdateData = true
+                    }
+                    
                     var datas: [KMEditPDFToolbarModel] = []
                     for key in contentViewC?.itemKeys ?? [] {
                         let model = KMEditPDFToolbarModel()

+ 1 - 1
PDF Office/PDF Master/Class/Tools/Search/Window/KMSearchReplaceWindowController.swift

@@ -299,7 +299,7 @@ class KMSearchReplaceWindowController: NSWindowController {
                 self?.handdler.showSelection(newSel)
             }
             if success {
-                self.handdler.showSelection(sel)
+//                self.handdler.showSelection(sel)
             }
         } else { // 先查找
             if self.finding_ {