Browse Source

【综合】tts 多次点击TTS弹窗的各个按钮后再关闭该弹窗,程序崩溃(已修复)

tangchao 1 year ago
parent
commit
2264172249

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/TTS/WindowController/KMTTSWindowController.swift

@@ -384,7 +384,7 @@ class KMTTSWindowController: NSWindowController, KMTTSManagerDelegate, NSWindowD
     //MARK: KMTTSManagerDelegate
     func ttsMananger(_ tts: KMTTSManager, willSpeak selection: CPDFSelection) {
 //        if (selection != nil) {
-            self.pdfView.setHighlightedSelection(selection, animated: false)
+            self.pdfView?.setHighlightedSelection(selection, animated: false)
 //        }
     }
     func ttsManangerDidFinishSpeech(_ tts: KMTTSManager) -> Bool {

+ 2 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/WindowController/KMAnnotationFontWindowController.swift

@@ -111,7 +111,8 @@ import Cocoa
     
     var annotation: CPDFAnnotation {
         set {
-            let equal: Bool = ((_annotation?.isEqual(newValue)) != nil)
+//            let equal: Bool = ((_annotation?.isEqual(newValue)) != nil)
+            let equal = self._annotation?.isEqual(to: newValue) ?? false
             if equal {
                 if _annotation is CPDFTextAnnotation {
                     let keys = ["string", "color"]