Browse Source

【综合】整理代码

tangchao 10 months ago
parent
commit
6814e31ca6

+ 1 - 33
PDF Office/PDF Master/Class/Common/Base/KMBaseViewController.swift

@@ -9,7 +9,6 @@ import Cocoa
 
 // 基类 [抽象类]
 class KMBaseViewController: NSViewController {
-    
     // 是否需要菜单
     var needMenu = false {
         didSet {
@@ -21,11 +20,6 @@ class KMBaseViewController: NSViewController {
         }
     }
     
-    // 是否能使用高级功能
-    var canUseAdvanced = false
-    // 是否能使用付费功能
-    var canPayFunction = false
-    
     deinit {
         Swift.debugPrint(self.className + " 已释放")
         
@@ -42,37 +36,11 @@ class KMBaseViewController: NSViewController {
         }
         
         self.addNotifations()
-        self._reloadAdvancedData()
-    }
-    
-    // Advanced
-    
-    @objc fileprivate func _advancedDidChange() {
-        self._reloadAdvancedData()
-    }
-    
-    fileprivate func _reloadAdvancedData() {
-//        Task { @MainActor in
-//            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-//                self.canUseAdvanced = false
-//            } else {
-//                self.canUseAdvanced = true
-//            }
-//            if (KMLightMemberManager.manager.canPayFunction() == false) {
-//                self.canPayFunction = false
-//            } else {
-//                self.canPayFunction = true
-//            }
-//        }
     }
     
     // Noti
     
-    func addNotifations() {
-        NotificationCenter.default.addObserver(self, selector: #selector(_advancedDidChange), name: NSNotification.Name(rawValue: ADVANCED_NOTIFICATION), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(_advancedDidChange), name: NSNotification.Name(rawValue: USER_INFO_CHANGE_NOTIFICATION), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(_advancedDidChange), name: NSNotification.Name(rawValue: USER_LOGINSTATE_NOTIFICATION), object: nil)
-    }
+    func addNotifations() { }
     
     func removeNotifations() {
         NotificationCenter.default.removeObserver(self)

+ 0 - 6
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -73,12 +73,6 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
         }
     }
     
-    override var canPayFunction: Bool {
-        didSet {
-            self.thumbnailView.limit = !self.canPayFunction
-        }
-    }
-    
     private var fileAttri_: KMFileAttribute?
     private var popOver_: NSPopover?
     

+ 0 - 7
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/KMThumbnailViewController.swift

@@ -35,15 +35,8 @@ class KMThumbnailViewController: KMBaseViewController {
         }
     }
     
-    override var canPayFunction: Bool {
-        didSet {
-            self.thumbnailView.limit = !self.canPayFunction
-        }
-    }
-    
     deinit {
         NotificationCenter.default.removeObserver(self)
-        Swift.debugPrint("KMThumbnailViewController 释放")
     }
     
     override func viewWillAppear() {

+ 21 - 171
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -1925,21 +1925,15 @@ extension KMMainViewController {
 //        progress.window?.contentView?.layer?.backgroundColor = NSColor.km_init(hex: "#ffffff").cgColor
 //        progress.progressField.textColor = NSColor.black
         progress.message = NSLocalizedString("Converting...", comment: "")
-        progressController = progress
-        progressController?.message = message
+        self.progressC = progress
+        self.progressC?.message = message
         if maxValue > 0 {
-            progressController?.indeterminate = false
-            progressController?.maxValue = Double(maxValue)
+            progressC?.indeterminate = false
+            progressC?.maxValue = Double(maxValue)
         } else {
-            progressController?.indeterminate = true
+            progressC?.indeterminate = true
         }
-        if maxValue > 0 {
-            progressController?.indeterminate = false
-            progressController?.maxValue = Double(maxValue)
-        } else {
-            progressController?.indeterminate = true
-        }
-        self.km_beginSheet(windowC: progressController!)
+        self.km_beginSheet(windowC: progressC!)
     }
     
     // 白边距
@@ -1954,8 +1948,8 @@ extension KMMainViewController {
        beginProgressSheet(with: KMLocalizedString("Cropping Pages", "Message for progress sheet"), maxValue: min(18, self.listView.document.pageCount))
        var rectArray: Array<NSRect> = []
         for i in 0 ..< self.listView.document.pageCount {
-            progressController?.increment(by: Double(i))
-            progressController?.doubleValue = Double(i)
+            progressC?.increment(by: Double(i))
+            progressC?.doubleValue = Double(i)
             let page = self.listView.document.page(at: i)
             var rect = KMCropTools.getPageForegroundBox(page!)
             let bounds: NSRect = (page?.bounds(for: .mediaBox))!
@@ -2004,8 +1998,8 @@ extension KMMainViewController {
         beginProgressSheet(with: KMLocalizedString("Cropping Pages", "Message for progress sheet"), maxValue: min(18, self.listView.document.pageCount))
         var rectArray: Array<NSRect> = []
          for i in 0 ..< self.listView.document.pageCount {
-             progressController?.increment(by: Double(i))
-             progressController?.doubleValue = Double(i)
+             progressC?.increment(by: Double(i))
+             progressC?.doubleValue = Double(i)
              let page = self.listView.document.page(at: i)
              var rect = KMCropTools.getPageForegroundBox(page!)
              let bounds: NSRect = (page?.bounds(for: .mediaBox))!
@@ -2058,12 +2052,12 @@ extension KMMainViewController {
                 if let page = self.listView.document.page(at: 0) {
                     rect[0] = KMCropTools.getPageForegroundBox(page)
                 }
-                progressController?.increment(by: 1)
+                progressC?.increment(by: 1)
             } else if (count < 19) {
                 for i in 0 ..< 19 {
                     if let page = self.listView.document.page(at: UInt(i)) {
                         rect[i % 2] = NSUnionRect(rect[i % 2], KMCropTools.getPageForegroundBox(page))
-                        progressController?.increment(by: Double(i))
+                        progressC?.increment(by: Double(i))
                     }
                 }
             } else {
@@ -2075,7 +2069,7 @@ extension KMMainViewController {
                         if let page = self.listView.document.page(at: UInt(k)) {
                             rect[k % 2] = NSUnionRect(rect[k % 2], KMCropTools.getPageForegroundBox(page))
                             cnt += 1
-                            progressController?.increment(by: Double(cnt))
+                            progressC?.increment(by: Double(cnt))
                         }
                     }
                 }
@@ -2132,150 +2126,6 @@ extension KMMainViewController {
         }
     }
     
-    private func cropCustomArea() {
-        self.listView.toolMode = .selectToolMode
-        
-        self.listView.autoScales = true
-        self.listView.autoScales = false
-        var pageHeight: CGFloat = NSHeight(self.listView.currentPage().bounds(for: self.listView.displayBox))
-        if (self.listView.displaysPageBreaks) {
-            pageHeight += 8
-        }
-        
-        var scaleFactor: CGFloat = fmax(self.listView.minimumScaleFactor, NSHeight(self.listView.frame)/pageHeight)
-//        if (scaleFactor < self.preView.scaleFactor) {
-            self.listView.scaleFactor = scaleFactor
-//        }
-        
-        let tipView = KMCropTipView()
-        tipView.setString(string: "请框选裁剪区域")
-        tipView.frame = self.topTipBox.contentView!.frame
-        tipView.autoresizingMask = NSView.AutoresizingMask(rawValue: 18)
-        self.addTopTip(tipView)
-        
-        tipView.enterAction = {
-            () in
-            var rect = NSIntegralRect(self.listView.currentSelectionRect())
-            if (NSIsEmptyRect(rect)) {
-                return
-            }
-            
-            let window = KMCropSettingWindowController(windowNibName: "KMCropSettingWindowController")
-            self.view.window?.beginSheet(window.window!)
-            self.cropSettingWindowController = window
-            
-            window.itemClick = { [self]
-                (index: Int) in
-                if (index == 1) { /// 取消
-                    self.view.window?.endSheet((self.cropSettingWindowController?.window)!)
-                    self.cropSettingWindowController = nil
-                    return
-                }
-                let pageRangeType = self.cropSettingWindowController.pageRangeIndex
-                let pageCount: Int = Int(self.listView.document.pageCount)
-                var pages: Array<Int> = []
-                if (pageRangeType == 0) { /// 当前页面
-                    pages.append(self.listView.currentPageIndex)
-                } else if (pageRangeType == 1) { /// 全部页面
-                    for i in 0 ..< pageCount {
-                        pages.append(i)
-                    }
-                } else if (pageRangeType == 2) { /// 奇数页面
-                    var string: String = ""
-                    for i in 0 ..< pageCount {
-                        if (i % 2 == 1) {
-                            continue
-                        }
-                        
-                        pages.append(i)
-                    }
-                } else if (pageRangeType == 3) { /// 偶数页面
-                    var string: String = ""
-                    for i in 0 ..< pageCount {
-                        if (i % 2 == 0) {
-                            continue
-                        }
-                        
-                        pages.append(i)
-                    }
-                } else { /// 自定义
-                    for i in self.cropSettingWindowController.pageRangePages {
-                        pages.append(i)
-                    }
-                }
-                
-                if (pages.count < 0) {
-                    let alert = NSAlert()
-                    alert.messageText = "请选择页面"
-                    alert.runModal()
-                    return
-                }
-                
-                var pageSize: NSSize = NSZeroSize
-                if (self.cropSettingWindowController.pageSize == "None") {
-                    
-                } else {
-                    pageSize = KMCropTools.getPageSizeValue(self.cropSettingWindowController.pageSize)
-                }
-                
-                for i in pages {
-                    var page: CPDFPage = self.listView.document.page(at: UInt(i))
-                    var rect = NSIntegralRect(self.listView.selectionRect)
-
-                    if (NSIsEmptyRect(rect)) {
-                        rect = KMCropTools.getPageForegroundBox(page)
-                    }
-                    
-                    var newRect = NSIntersectionRect(rect, (page.bounds(for: .mediaBox)))
-                    page.setBounds(newRect, for: .cropBox)
-                    
-                    if (pageSize.width == 0 && pageSize.height == 0) {
-                        
-                    } else {
-//                        let tiffData = page.pdfListViewTIFFData(for: rect)
-                        let index: UInt = (page.pageIndex())
-//                        let newPage: CPDFPage = nil
-//                        self.listView.document.removePage(at: index)
-//                        newPage.setBounds(NSMakeRect(0, 0, pageSize.width, pageSize.height), for: .cropBox)
-                        //        let result = self.preView.document.insertPageObject(newPage, at: index)
-                        let result = self.listView.document.insertPage(pageSize, at: index)
-                    }
-                }
-                
-                /// 保存到临时路径
-                let toPath: String = self.listView.document.documentURL.path
-                let documentPath = NSTemporaryDirectory()
-                let tempPath: String = "\(documentPath)/\(toPath.lastPathComponent)"
-                if (FileManager.default.fileExists(atPath: tempPath)) {
-                    try?FileManager.default.removeItem(atPath: tempPath)
-                }
-
-                let result = self.listView.document.write(to: URL(fileURLWithPath: tempPath))
-                if (result) {
-                    if (FileManager.default.fileExists(atPath: toPath)) {
-                        try?FileManager.default.removeItem(atPath: toPath)
-                    }
-                    
-                    try?FileManager.default.moveItem(atPath: tempPath, toPath: toPath)
-                } else {
-                    try?FileManager.default.removeItem(atPath: tempPath)
-                }
-                DispatchQueue.main.async {
-                    self.listView.toolMode = .textToolMode
-
-                    /// 刷新预览视图
-                    self.listView.layoutDocumentView()
-                    
-                    self.listView.displayBox = .cropBox
-                }
-                
-                self.view.window?.endSheet((self.cropSettingWindowController?.window)!)
-                self.cropSettingWindowController = nil
-                self.addTopTip(nil)
-            }
-        }
-    }
-    
     @objc private func shareDocument(sender:KMToolbarViewController, limit: Bool = false) {
         if (limit) {
             var doucumentURL : URL = self.listView.document.documentURL
@@ -3115,21 +2965,21 @@ extension KMMainViewController {
         progress.window?.contentView?.layer?.backgroundColor = NSColor.km_init(hex: "#36383B").cgColor
         progress.progressField.textColor = NSColor.white
         progress.message = NSLocalizedString("Converting...", comment: "")
-        progressController = progress
-        progressController?.message = message
+        progressC = progress
+        progressC?.message = message
         if maxValue > 0 {
-            progressController?.indeterminate = false
-            progressController?.maxValue = Double(maxValue)
+            progressC?.indeterminate = false
+            progressC?.maxValue = Double(maxValue)
         } else {
-            progressController?.indeterminate = true
+            progressC?.indeterminate = true
         }
-        self.km_beginSheet(windowC: progressController!)
+        self.km_beginSheet(windowC: progressC!)
     }
     
     func dismissProgressSheet() {
-        progressController?.stopAnimation()
+        progressC?.stopAnimation()
         self.km_endSheet()
-        progressController = nil
+        progressC = nil
     }
     
     func converFilesToPath(files: Array<KMBatchOperateFile>) -> [String] {

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

@@ -1313,8 +1313,8 @@ extension KMMainViewController {
     }
 }
 
-extension KMMainViewController: NSMenuItemValidation, NSMenuDelegate {
-    func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
+extension KMMainViewController {
+    override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
         if (menuItem.action == #selector(menuItemAction_currentWindowName)) {
             menuItem.title = (self.myDocument?.fileURL!.lastPathComponent)!
             return true

+ 33 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -1855,5 +1855,38 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
         }
         return true
     }
+    
+    func pdfListView(_ sender: CPDFListView!, showSnapshotAtPageNumber pageNum: Int, for rect: NSRect, scaleFactor: CGFloat, autoFits: Bool) {
+        let swc = KMSnapshotWindowController(windowNibName: "SnapshotWindow")
+        swc.delegate = self
+        swc.setPdfDocument(self.listView.document, goToPageNumber: pageNum, rect: rect, scaleFactor: scaleFactor, autoFits: autoFits)
+        swc.forceOnTop = self.interactionMode != .normal
+        self.myDocument?.addWindowController(swc)
+    }
+    
+    func pdfListView(_ pdfView: CPDFListView!, documentDataDidChanged docData: Any!, withInfo info: [AnyHashable : Any]!) {
+        if let data = info?[CPDFListView.outlineKey] as? Bool, data { // 大纲改变
+            guard let ol = docData as? CPDFOutline else {
+                return
+            }
+            let add = info?[CPDFListView.outlineAddKey] as? Bool ?? false
+            let remove = info?[CPDFListView.outlineRemoveKey] as? Bool ?? false
+            if add {
+                self.leftSideViewController.addOutlineAfter(ol)
+            }
+            if remove {
+                self.leftSideViewController.removeOutlineAfter(ol)
+            }
+            
+            let demote = info?[CPDFListView.outlineDemoteKey] as? Bool ?? false
+            let promote = info?[CPDFListView.outlinePromoteKey] as? Bool ?? false
+            if demote {
+                self.leftSideViewController.demoteOutlineAfter(ol)
+            }
+            if promote {
+                self.leftSideViewController.promoteOutlineAfter(ol)
+            }
+        }
+    }
 }
 

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

@@ -7,8 +7,7 @@
 
 import Cocoa
 
-@objcMembers class KMMainViewController: NSViewController,NSTextFieldDelegate {
-    
+@objcMembers class KMMainViewController: KMBaseViewController, NSTextFieldDelegate {
     @IBOutlet var PDFContendView: NSView!
     @IBOutlet var centerContentView: NSView!
     @IBOutlet var listView: CPDFListView!
@@ -149,7 +148,6 @@ import Cocoa
     }
     
     var autoSaveTimer: Timer?
-    var progressController: SKProgressController?
     private var _documentFirstLoad: Bool = true
     
     var eventMonitor: Any?
@@ -708,6 +706,7 @@ import Cocoa
     }
     
     //MARK: - AI
+    
     func loadAIIconView() -> Void {
         NotificationCenter.default.addObserver(self, selector: #selector(aiTipIconViewShowStateChangeNoti), name: NSNotification.Name(rawValue: "kAIIconShowStateChangeNotification"), object: nil)
         if self.aiTipView == nil {
@@ -797,7 +796,6 @@ import Cocoa
         var rect = self.aiTipView.bounds
         rect.origin.y += 20
         popover.show(relativeTo: rect, of: self.aiTipView, preferredEdge: .minY)
-
     }
     
     func loadAIConfigWindowWithType(_ type: AIConfigType) -> Void {
@@ -838,6 +836,7 @@ import Cocoa
     }
     
     //MARK: - 引导
+    
     func loadFunctionGuide() -> Void {
         DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1) {
             if self.view.window != nil {
@@ -1155,7 +1154,8 @@ import Cocoa
         return pageCount > 30
     }
     
-    // MARK: Redact 【标记密文】
+    // MARK: - Redact 【标记密文】
+    
     func exeRedactConfirm(_ type: KMRedactConfirmType, callback: @escaping () -> ()?) {
         let windowController = KMRedactConfirmWindowController(type)
         self.currentWindowController = windowController
@@ -1273,6 +1273,7 @@ import Cocoa
     }
     
     //MARK: - Form
+    
     func showFormAlertView() {
         if (formAlertView == nil) {
             formAlertView = KMFormAlertView()
@@ -1305,8 +1306,7 @@ import Cocoa
         }
     }
     
-    // MARK: -
-    // MARK: 显示合并窗口
+    // MARK: - 显示合并窗口
     
     public func showMergeWindow(url: URL? = nil, _ password: String?) {
         DispatchQueue.main.async {
@@ -1401,8 +1401,7 @@ import Cocoa
         NSWindow.currentWindow().beginSheet(controller.window!)
     }
     
-    // MARK: -
-    // MARK: 保存文档
+    // MARK: - 保存文档
     
     internal func needSaveDocument() -> Bool {
         if (self.isPDFDocumentEdited) {
@@ -1470,13 +1469,13 @@ import Cocoa
     internal func saveDocumentWithProgressAlert(callback:@escaping KMCommonBlock) {
         // 显示进度
         self.showProgressWindow(message: NSLocalizedString("Save", comment: "") + "PDF")
-        self.progressController?.maxValue = 3.0
-        self.progressController?.increment(by: 1.0)
+        self.progressC?.maxValue = 3.0
+        self.progressC?.increment(by: 1.0)
         // 保存文档
         self.asyncSaveDocument { [unowned self] params in
             // 执行进度 [假进度]
-            self.progressController?.increment(by: 1.0)
-            self.progressController?.increment(by: 1.0)
+            self.progressC?.increment(by: 1.0)
+            self.progressC?.increment(by: 1.0)
             
 //            DispatchQueue.main.async {
             DispatchQueue.main.asyncAfter(deadline: .now()+0.1) {
@@ -1614,8 +1613,8 @@ import Cocoa
         AutoSaveManager.manager.removeAutoSavePath(self.listView?.document?.documentURL.path ?? "")
     }
     
-    // MARK: -
-    // MARK: 选择 PDFDisplay 模式
+    // MARK: - 选择 PDFDisplay 模式
+    
     @objc public func selectDisplay(display: KMPDFDisplayType, viewSettingIsReload: Bool = true) {
         let toolModel = self.listView.toolMode
         self.isReadMode = false
@@ -1703,35 +1702,9 @@ import Cocoa
             self.homeVC?.newFromImages()
         }
     }
-    // MARK: -
-    // MARK: Progress
-    
-    func showProgressWindow(message: String = "") {
-        if (self.progressController != nil) {
-            self.hiddenProgressWindow()
-        }
-        
-        let progress = SKProgressController()
-        progress.window?.backgroundColor = NSColor.km_init(hex: "#36383B")
-        progress.window?.contentView?.wantsLayer = true
-        progress.window?.contentView?.layer?.backgroundColor = NSColor.km_init(hex: "#36383B").cgColor
-        progress.progressField.textColor = NSColor.white
-        progress.showClose = false
-        progress.message = message
-
-        self.progressController = progress
-        self.view.window?.beginSheet(progress.window!)
-    }
-    
-    func hiddenProgressWindow() {
-        if (self.progressController != nil) {
-            self.view.window?.endSheet((self.progressController?.window)!)
-            self.progressController = nil
-        }
-    }
     
-    // MARK -
     // MARK - Event 监听
+    
     private func addEventMonitor() {
         if (self.eventMonitor != nil) {
             self.removeEventMonitor()
@@ -1838,8 +1811,7 @@ import Cocoa
         }
     }
     
-    // MARK: -
-    // MARK: Tools
+    // MARK: - Tools
     
     func pdfViewCanHorizontalScroll() -> Bool {
         let scroll = self.listView.scroll()
@@ -2140,10 +2112,6 @@ import Cocoa
             return
         }
         if self.interactionMode == .presentation {
-            //        if _isShowToolbar {
-            //            self.toolbarViewController.hiddenToolbar(true)
-            //        }
-            //
             //        if self.pdfView().currentPage()?.isEqual(page) == false {
             //            self.pdfView().go(to: page)
             //        }
@@ -2191,77 +2159,6 @@ import Cocoa
         }
     }
     
-    func addTopTip(_ view: NSView?) {
-        if (Thread.isMainThread) {
-            if (view == nil) {
-                let contentView: NSView = self.topTipBox.contentView!
-                for subview in contentView.subviews {
-                    subview.removeFromSuperview()
-                }
-                self.topTipBox.isHidden = true
-                return
-            }
-            
-            let contentView: NSView = self.topTipBox.contentView!
-            for subview in contentView.subviews {
-                subview.removeFromSuperview()
-            }
-            self.topTipBox.isHidden = false
-            self.topTipBox.contentView?.addSubview(view!)
-        } else {
-            DispatchQueue.main.async {
-                if (view == nil) {
-                    let contentView: NSView = self.topTipBox.contentView!
-                    for subview in contentView.subviews {
-                        subview.removeFromSuperview()
-                    }
-                    self.topTipBox.isHidden = true
-                    return
-                }
-                
-                let contentView: NSView = self.topTipBox.contentView!
-                for subview in contentView.subviews {
-                    subview.removeFromSuperview()
-                }
-                self.topTipBox.isHidden = false
-                self.topTipBox.contentView?.addSubview(view!)
-            }
-        }
-    }
-    
-    func pdfListView(_ sender: CPDFListView!, showSnapshotAtPageNumber pageNum: Int, for rect: NSRect, scaleFactor: CGFloat, autoFits: Bool) {
-        let swc = KMSnapshotWindowController(windowNibName: "SnapshotWindow")
-        swc.delegate = self
-        swc.setPdfDocument(self.listView.document, goToPageNumber: pageNum, rect: rect, scaleFactor: scaleFactor, autoFits: autoFits)
-        swc.forceOnTop = self.interactionMode != .normal
-        self.myDocument?.addWindowController(swc)
-    }
-    
-    func pdfListView(_ pdfView: CPDFListView!, documentDataDidChanged docData: Any!, withInfo info: [AnyHashable : Any]!) {
-        if let data = info?[CPDFListView.outlineKey] as? Bool, data { // 大纲改变
-            guard let ol = docData as? CPDFOutline else {
-                return
-            }
-            let add = info?[CPDFListView.outlineAddKey] as? Bool ?? false
-            let remove = info?[CPDFListView.outlineRemoveKey] as? Bool ?? false
-            if add {
-                self.leftSideViewController.addOutlineAfter(ol)
-            }
-            if remove {
-                self.leftSideViewController.removeOutlineAfter(ol)
-            }
-            
-            let demote = info?[CPDFListView.outlineDemoteKey] as? Bool ?? false
-            let promote = info?[CPDFListView.outlinePromoteKey] as? Bool ?? false
-            if demote {
-                self.leftSideViewController.demoteOutlineAfter(ol)
-            }
-            if promote {
-                self.leftSideViewController.promoteOutlineAfter(ol)
-            }
-        }
-    }
-    
     // MARK: Split View
     
     func changePDFDocument(isChange: Bool, replaceBlock: @escaping (String) -> Void) {
@@ -2327,13 +2224,13 @@ extension KMMainViewController {
     }
     
     // MARK: - Recommond活动
+    
     func loadRecommondPopWindow() {
         if IAPProductsManager.default().isAvailableAllFunction() {
             return
         }
         
         if let info = KMAdvertisementManager.manager.info.popWindowContent?.content?.first {
-            
             if recommondPopWindowVC == nil {
                 recommondPopWindowVC = KMRecommondPopWindow()
             }