Browse Source

综合-编辑新增数据容错处理和页签新增替换和刷新页签

tangchao 1 year ago
parent
commit
287b1eb6c4

+ 0 - 16
PDF Office/PDF Master/Class/Document/KMMainDocument.swift

@@ -80,7 +80,6 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
 //                self.addWindowController(currentWindowController!)
 //                mainViewController.browserWindowController = currentWindowController
 
-#if DEBUG
                 let activeBrowser = (currentWindowController?.browser.activeTabContents())! as CTTabContents
                 let activeIndex = Int((currentWindowController?.browser.activeTabIndex())!)
                 self.addWindowController(currentWindowController!)
@@ -104,21 +103,6 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
                 } else {
                     currentWindowController?.browser.add(self, at: Int32()-1, inForeground: true)
                 }
-#else
-                // MARK TODO: 流程调整“开启PDF后,替换Home标签”
-                let activeBrowser = (currentWindowController?.browser.activeTabContents())! as CTTabContents
-                let activeIndex = Int((currentWindowController?.browser.activeTabIndex())!)
-                currentWindowController?.browser.add(self, at: Int32()-1, inForeground: true)
-                self.addWindowController(currentWindowController!)
-                mainViewController?.browserWindowController = currentWindowController
-
-                let ishome = activeBrowser.isHome as Bool
-                let isfirstTab = (activeIndex == 0)
-                if ishome && !isfirstTab {
-                    let contents = activeBrowser.browser.tabContents(at: Int32(activeIndex)) as CTTabContents
-                    activeBrowser.browser.closeTab(Int32(activeIndex))
-                }
-#endif
             }
         }
     }

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift

@@ -581,7 +581,7 @@ extension KMEditPDFTextPropertyViewController {
         for index in 0...defaultFreeTextPropertArray.count - 1 {
             let dic = defaultFreeTextPropertArray[index]
             let string = textPresuppositionArray[index]
-            let redefine: Bool = dic["redefine"] as! Bool
+            let redefine: Bool = (dic["redefine"] as? Bool) ?? false
             if redefine {
                 textPresuppositionArray[index] = "*" + string
             } else {