Parcourir la source

【fix】【标记密文】添加标记密文区域后,点击退出没有弹出是否保存弹窗(App Store有该流程)

tangchao il y a 6 mois
Parent
commit
f4d47834a9

+ 3 - 0
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift

@@ -769,6 +769,7 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
                 if resp != .alertFirstButtonReturn {  // 取消
                     return
                 }
+                control?.redactPdfView.newAddAnnotation.removeAll()
             }
         }
         if self.lastItemBox != nil {
@@ -997,6 +998,7 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
                 if resp != .alertFirstButtonReturn {  // 取消
                     return
                 }
+                control?.redactPdfView.newAddAnnotation.removeAll()
             }
         }
         
@@ -1048,6 +1050,7 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
                 if resp != .alertFirstButtonReturn {  // 取消
                     return
                 }
+                control?.redactPdfView.newAddAnnotation.removeAll()
             }
         }
         

+ 7 - 7
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -776,13 +776,13 @@ import Cocoa
         let controller = self._getPDFRedactController()
         if let data = controller {
             if data.redactPdfView.newAddAnnotation.count > 0 {
-//                KMAlertTool.runModel(message: "", informative: KMLocalizedString("There are unapplied redactions in this file. Exit will not save redaction.", nil), buttons: [KMLocalizedString("Exit", nil), KMLocalizedString("Cancel", nil)]) { response in
-//                    if response == .alertFirstButtonReturn {
-                controller?.redactPdfView.newAddAnnotation.removeAll()
-//                        self.exitRedact()
-//                    }
-//                }
-//                return
+                KMAlertTool.runModel(message: "", informative: KMLocalizedString("There are unapplied redactions in this file. Exit will not save redaction.", nil), buttons: [KMLocalizedString("Exit", nil), KMLocalizedString("Cancel", nil)]) { response in
+                    if response == .alertFirstButtonReturn {
+                        controller?.redactPdfView.newAddAnnotation.removeAll()
+                        self.exitRedact()
+                    }
+                }
+                return
             }
         }
         NSColorPanel.shared.showsAlpha = true