ソースを参照

【2025】【Protect】标记密文, 框选密文区域后,点击应用,会多余一个确认提示 - 修复

lizhe 1 ヶ月 前
コミット
81fa8504bd

+ 10 - 6
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -4370,7 +4370,7 @@ extension KMMainViewController: KMPDFToolbarControllerDelegate {
             } else if itemIdentifier == KMPDFToolbar_protect_redact_Apply_Identifier {
                 toolbarViewModeChanged()
                 
-                self.redactApplyAction()
+                self.redactApplyAction(needAlert: false)
                 
             } else if itemIdentifier == KMPDFToolbar_protect_redact_Exit_Identifier {
                 toolbarViewModeChanged()
@@ -7513,12 +7513,16 @@ extension KMMainViewController {
     }
     
     // MARK: - Redact 【标记密文】
-    func redactApplyAction() {
-        let returnCode = KMAlertTool.runModelForMainThread_r(message: "", informative: KMLocalizedString("This will permanently remove the redacted information from this document. Once you save this document, you won’t be able to retrieve the redacted information."), buttons: [KMLocalizedString("Apply"), KMLocalizedString("Cancel")])
-        if returnCode == .alertFirstButtonReturn {
-            DispatchQueue.main.async {
-                self.saveAsPath()
+    func redactApplyAction(needAlert: Bool = true) {
+        if needAlert {
+            let returnCode = KMAlertTool.runModelForMainThread_r(message: "", informative: KMLocalizedString("This will permanently remove the redacted information from this document. Once you save this document, you won’t be able to retrieve the redacted information."), buttons: [KMLocalizedString("Apply"), KMLocalizedString("Cancel")])
+            if returnCode == .alertFirstButtonReturn {
+                DispatchQueue.main.async {
+                    self.saveAsPath()
+                }
             }
+        } else {
+            self.saveAsPath()
         }
     }