Przeglądaj źródła

Merge branch 'develop_2025' of git.kdan.cc:Mac_PDF/PDF_Office into develop_2025

niehaoyu 1 miesiąc temu
rodzic
commit
695cec8838

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

@@ -4391,7 +4391,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()
@@ -7534,12 +7534,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()
         }
     }