Przeglądaj źródła

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

liujiajie 11 miesięcy temu
rodzic
commit
a81b998217

+ 1 - 0
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift

@@ -44,6 +44,7 @@ import Cocoa
         super.windowDidLoad()
         
         NSImage.makeTextAlignImages()
+        NSImage.makeAdornImages()
         window?.backgroundColor = NSColor.km_init(hex: "#DFE1E5")
         self.window?.appearance = NSApp.appearance
         self.window?.titlebarAppearsTransparent = true

+ 20 - 0
PDF Office/PDF Master/Class/Common/Tools/KMTools.swift

@@ -682,6 +682,26 @@ extension KMTools {
         }
     }
     
+    private static var dateFormatter_: DateFormatter?
+    @objc class func timeString(timeDate date: Date) -> String {
+        if dateFormatter_ == nil {
+            dateFormatter_ = DateFormatter()
+        }
+        let calendar = Calendar.current
+        let nowCmps = calendar.dateComponents([.day, .month, .year], from: Date())
+        let currentCmps = calendar.dateComponents([.day, .month, .year], from: date)
+        if (currentCmps.year == nowCmps.year) {
+            if (currentCmps.month == nowCmps.month && currentCmps.day == nowCmps.day) {
+                dateFormatter_?.dateFormat = "HH:mm"
+            } else {
+                dateFormatter_?.dateFormat = "MM-dd, HH:mm"
+            }
+        } else {
+            dateFormatter_?.dateFormat = "yyyy-MM-dd, HH:mm"
+        }
+        return dateFormatter_?.string(from: date) ?? ""
+    }
+    
     // MARK: - Private Methods
     
     @objc fileprivate class func _documentAddWatermark(document: CPDFDocument) -> CPDFDocument? {

+ 15 - 20
PDF Office/PDF Master/Class/Document/KMMainDocument.swift

@@ -186,18 +186,14 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
         self.view = mainViewController?.view
         
         if let currentBrowser = currentWindowController?.browser {
-//                currentWindowController?.browser.add(self, at: Int32()-1, inForeground: true)
-//                self.addWindowController(currentWindowController!)
-//                mainViewController.browserWindowController = currentWindowController
-
             let activeBrowser = currentBrowser.activeTabContents()
             let activeIndex = currentBrowser.activeTabIndex()
-            self.addWindowController(currentWindowController!)
-            self.mainViewController?.browserWindowController = currentWindowController
-
             let ishome = activeBrowser?.isHome ?? false
             let isfirstTab = (activeIndex == 0)
-            if ishome && !isfirstTab {
+            if ishome && !isfirstTab { // 替换 【标签需要被替换】
+                self.addWindowController(currentWindowController!)
+                self.mainViewController?.browserWindowController = currentWindowController
+                
                 // 替换 document
                 currentWindowController?.browser.replaceTabContents(at: Int32(activeIndex), with: self)
                 // 刷新标签
@@ -213,24 +209,23 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
                 }
             } else {
                 if currentWindowController?.browser.tabCount() ?? 0 > 1 && !IAPProductsManager.default().isAvailableAllFunction() {
-                    reopenDocument()
-                }else {
+                    // 开启新窗口
+                    let browser = KMBrowser.init() as KMBrowser
+                    browser.windowController = KMBrowserWindowController.init(browser: browser)
+                    browser.addHomeTabContents()
+                    browser.windowController.showWindow(self)
+                    browser.add(self, at: Int32()-1, inForeground: true)
+                    self.addWindowController(browser.windowController)
+                    self.mainViewController?.browserWindowController = browser.windowController as? KMBrowserWindowController
+                }else { // 正常拼接到后面
+                    self.addWindowController(currentWindowController!)
+                    self.mainViewController?.browserWindowController = currentWindowController
                     currentWindowController?.browser.add(self, at: Int32()-1, inForeground: true)
                 }
             }
         }
     }
     
-    func reopenDocument() {
-        let browser = KMBrowser.init() as KMBrowser
-        browser.windowController = KMBrowserWindowController.init(browser: browser)
-        browser.addHomeTabContents()
-        browser.windowController.showWindow(self)
-        browser.add(self, at: Int32()-1, inForeground: true)
-//        addWindowController(browser.windowController)
-//        self.mainViewController?.browserWindowController = browser.windowController as? KMBrowserWindowController
-    }
-    
     override func showWindows() {
         super.showWindows()
         

+ 5 - 13
PDF Office/PDF Master/Class/PDFTools/PageEdit/Window/KMPDFEditExtractWindow.swift

@@ -27,6 +27,7 @@ class KMPDFEditExtractWindow: NSWindowController {
         self._pdfDocument = document
         
         self._attribute = KMFileAttribute()
+        self._attribute?.pageCnt = Int(document.pageCount)
         if (pageString.isEmpty == false) {
             self._selectedPagesName = pageString
             self._attribute?.bAllPage = false
@@ -37,7 +38,6 @@ class KMPDFEditExtractWindow: NSWindowController {
             self._attribute?.pagesType = .all
         }
         self._attribute?.filePath = document.documentURL.path
-//        self._attribute?.pdfDocument = self._pdfDocument!
     }
     
     convenience init(fileURL documentPath: URL, selectedPagesName pageString: String) {
@@ -76,13 +76,6 @@ class KMPDFEditExtractWindow: NSWindowController {
         self.extractAsDocumentsPerPageButton.wantsLayer = true
     }
     
-    /*
-     - (void)updateButtonStateWithONButton:(NSButton *)sender
-     {
-         sender.state = NSControlStateValueOn;
-     }
-     */
-    
     @IBAction func buttonItemClicked_Cancel(_ sender: AnyObject) {
         self._pdfDocument = nil;
 
@@ -94,10 +87,9 @@ class KMPDFEditExtractWindow: NSWindowController {
     
     @IBAction func buttonItemClicked_Extract(_ sender: AnyObject) {
         if let data = self._attribute?.fetchSelectPages().isEmpty, data {
-            let alert = NSAlert()
-            alert.alertStyle = .critical
-            alert.messageText = String(format: "%@ %@", self._attribute?.filePath.lastPathComponent ?? "", KMLocalizedString("Invalid page range or the page number is out of range. Please try again.", nil))
-            alert.runModal()
+            Task {
+                _ = await KMAlertTool.runModel(message: String(format: "%@ %@", self._attribute?.filePath.lastPathComponent ?? "", KMLocalizedString("Invalid page range or the page number is out of range. Please try again.", nil)))
+            }
             return
         }
         
@@ -107,7 +99,7 @@ class KMPDFEditExtractWindow: NSWindowController {
             Task {
                 _ = await KMAlertTool.runModel(message: String(format: "%@ %@", self._attribute?.filePath.lastPathComponent ?? "", KMLocalizedString("Invalid page range or the page number is out of range. Please try again.", nil)))
             }
-            return;
+            return
         }
         guard let block = self.callback else {
             return

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/SelfSign/Window/KMProfileInfoWindowController.swift

@@ -404,10 +404,10 @@ extension KMProfileInfoWindowController: NSTableViewDelegate, NSTableViewDataSou
             if let data = cellView?.isKind(of: KMProfileCellView.self), data {
                 let cellView1 = cellView as! KMProfileCellView
                 if (i == self.tableView.selectedRow) {
-                    cellView1.detailtextField.textColor = .white
+//                    cellView1.detailtextField.textColor = .white
                     cellView1.addButton.setTitleColor(NSColor.white)
                 } else {
-                    cellView1.detailtextField.textColor = NSColor.secondaryLabelColor
+//                    cellView1.detailtextField.textColor = NSColor.secondaryLabelColor
                     cellView1.addButton.setTitleColor(NSColor.systemBlue)
                 }
             }

+ 14 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Thumbnail.swift

@@ -37,7 +37,6 @@ extension KMLeftSideViewController {
     
     public func reloadThumbnailSize() {
         let defaultSize = roundf(KMPreference.shared.thumbPageSize)
-//            var thumbnailSize = (defaultSize < TINY_SIZE + FUDGE_SIZE) ? TINY_SIZE : (defaultSize < SMALL_SIZE + FUDGE_SIZE) ? SMALL_SIZE : (defaultSize < LARGE_SIZE + FUDGE_SIZE) ? LARGE_SIZE : HUGE_SIZE
         var thumbnailSize = TINY_SIZE
         if defaultSize < TINY_SIZE + FUDGE_SIZE {
             
@@ -100,7 +99,8 @@ extension KMLeftSideViewController {
     }
     
     func thumb_selectRowIndexsIfNeed(_ indexs: IndexSet) {
-        if self.type.methodType != .Thumbnail && self.mainViewController.isReadMode == false {
+        let isReadMode = self.mainViewController?.isReadMode ?? false
+        if self.type.methodType != .Thumbnail && isReadMode == false {
             return
         }
         
@@ -150,6 +150,18 @@ extension KMLeftSideViewController {
         self.thumbnailTableView.allowsMultipleSelection = true
         self.thumbnailTableView.selectionHighlightStyle = .none
     }
+    
+    func thumb_fetchSelectedRows() -> [Int]? {
+        return self.thumbnailTableView.selectedRowIndexes.sorted()
+    }
+    
+    func updateThumbnailSelection() {
+        let pageIndex = self.listView.currentPageIndex
+        self.updatingThumbnailSelection = true
+        self.thumbnailTableView.km_safe_selectRowIndexes(IndexSet(integer: pageIndex), byExtendingSelection: false)
+        self.thumbnailTableView.scrollRowToVisible(pageIndex)
+        self.updatingThumbnailSelection = false
+    }
 }
 
 // MARK: - Others

+ 18 - 66
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift

@@ -271,6 +271,7 @@ class KMLeftSideViewController: KMSideViewController {
     }()
     var dragIn = false
     var dragedIndexPaths: [Int] = []
+    var updatingThumbnailSelection = false
     
     override func loadView() {
         super.loadView()
@@ -366,11 +367,6 @@ class KMLeftSideViewController: KMSideViewController {
             }
         }
         
-//        self.button.setHelp(KMLocalizedString("View Thumbnails", "Tool tip message"), for: KMLeftSidePaneState.thumbnail.rawValue)
-//        self.button.setHelp(KMLocalizedString("View Outline", "Tool tip message"), for: KMLeftSidePaneState.outline.rawValue)
-//        self.alternateButton.setHelp(KMLocalizedString("Separate search results", "Tool tip message"), for: KMFindPaneState.singular.rawValue)
-//        self.alternateButton.setHelp(KMLocalizedString("Group search results by page", "Tool tip message"), for: KMFindPaneState.grouped.rawValue)
-        
         let menu = NSMenu()
         _ = menu.addItem(title: KMLocalizedString("Whole Words Only", "Menu item title"), action: #selector(toggleWholeWordSearch), target: self)
         _ = menu.addItem(title: KMLocalizedString("Ignore Case", "Menu item title"), action: #selector(toggleCaseInsensitiveSearch), target: self)
@@ -454,7 +450,7 @@ class KMLeftSideViewController: KMSideViewController {
         frame.size.height = self.snapshotTableView.enclosingScrollView?.superview?.frame.size.height ?? 0
         self.snapshotTableView.enclosingScrollView?.frame = frame
         
-//        [self updateThumbnailSelection];
+        self.updateThumbnailSelection()
     }
     
     func displayFindViewAnimating(_ animate: Bool) {
@@ -693,47 +689,15 @@ class KMLeftSideViewController: KMSideViewController {
     }
     
     func resetThumbnails() {
-//        [self willChangeValueForKey:THUMBNAILS_KEY];
-//        self.thumbnailCacheSize = 160
         self.thumbnails.removeAll()
-        let pageLabels = self.listView.document.pageLabels()
+        let pageLabels = self.listView?.document?.pageLabels() ?? []
         if (pageLabels.isEmpty == false) {
-            let isLocked = self.listView.document.isLocked
-            let firstPage = self.listView.document.page(at: 0)
-            let emptyPage = CPDFPage()
-            let firstFrame = firstPage?.bounds(for: .cropBox) ?? .zero
-            let firstFrame2 = firstPage?.bounds(for: .mediaBox) ?? .zero
-            emptyPage.setBounds(firstFrame, for: .cropBox)
-            emptyPage.setBounds(firstFrame2, for: .mediaBox)
-            emptyPage.rotation = firstPage?.rotation ?? 0
-            
-            let pageImage = firstPage?.thumbnail(of: NSMakeSize(self.thumbnailCacheSize, self.thumbnailCacheSize))
-//            NSImage * = [emptyPage thumbnailWithSize:thumbnailCacheSize forBox:[pdfView displayBox]];
-            var rect: NSRect = .zero
-            rect.size = pageImage?.size ?? .zero
-            let width = 1.2 * fmin(NSWidth(rect), NSHeight(rect))
-            rect = NSInsetRect(rect, 0.5 * (NSWidth(rect) - width), 0.5 * (NSHeight(rect) - width));
-            
-            pageImage?.lockFocus()
-//            NSImage(named: NSImage.applicationIconName)?.draw(in: rect, from: .zero, operation: .sourceOver, fraction: 0.5)
-            if (isLocked) {
-                NSWorkspace.shared.icon(forFileType: NSFileTypeForHFSTypeCode(OSType(kLockedBadgeIcon))).draw(in: rect, from: .zero, operation: .sourceOver, fraction: 0.5)
-                //                [[[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kLockedBadgeIcon)] drawInRect:rect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:0.5];
-            }
-            pageImage?.unlockFocus()
-            
             for (i, label) in pageLabels.enumerated() {
-                let firstPage = self.listView.document.page(at: UInt(i))
-                let size = NSMakeSize(self.thumbnailCacheSize, self.thumbnailCacheSize)
-//                let pageImage = firstPage!.thumbnail(of: size)
                 let thumbnail = KMThumbnail(image: nil, label: label, pageIndex: i)
-                //                thumbnail.delegate = self
                 thumbnail.dirty = true
                 self.thumbnails.append(thumbnail)
             }
         }
-//        [self didChangeValueForKey:THUMBNAILS_KEY];
-//        [self allThumbnailsNeedUpdate];
         
         DispatchQueue.main.async {
             let ris = self.thumbnailTableView.selectedRowIndexes
@@ -874,11 +838,8 @@ extension KMLeftSideViewController: KMBotaTableViewDelegate {
                     return
                 }
                 for page in self._copysPages.reversed() {
-//                    if let newPage = page.copy() as? CPDFPage {
-                        self.listView.document.insertPageObject(page, at: index)
-//                    }
+                    self.listView.document.insertPageObject(page, at: index)
                     self.listView.layoutDocumentView()
-//                    [pageLabels setArray:[[pdfView document] pageLabels]];
                     self.resetThumbnails()
                     let pageIndex = min(index, self.listView.document.pageCount-1)
                     self.listView.go(toPageIndex: Int(pageIndex), animated: true)
@@ -1143,7 +1104,7 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
     
     func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
         if tableView.isEqual(to: self.thumbnailTableView) {
-            let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMThumbnailTableviewCell"), owner: self) as! KMThumbnailTableviewCell
+            let cell = tableView.makeView(withIdentifier: KMThumbnailTableviewCell.km_identifier, owner: self) as! KMThumbnailTableviewCell
             let thumbnail = self.thumbnails[row]
             cell.pageNumLabel.stringValue = thumbnail.label
 //            cell.thumImage.image = thumbnail.image
@@ -1178,14 +1139,14 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
                 cell.sizeLabel.isHidden = true
             }
             cell.sizeTopConstant.constant = cell.sizeLabel.isHidden ? -cell.sizeLabel.frame.size.height : 0
-            if(self.thumbnailTableView.selectedRowIndexes.contains(row)) {
+            if (self.thumbnailTableView.selectedRowIndexes.contains(row)) {
                 cell.isSelectCell = true
             } else {
                 cell.isSelectCell = false
             }
             return cell
         } else if (tableView.isEqual(to: self.findTableView)) {
-            let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMFindTableviewCell"), owner: self) as! KMFindTableviewCell
+            let cell = tableView.makeView(withIdentifier: KMFindTableviewCell.km_identifier, owner: self) as! KMFindTableviewCell
              let selection = searchResults[row]
             if let data = tableColumn?.identifier.rawValue, data == kResultsColumnId.rawValue {
                 cell.resultLabel.attributedStringValue = selection.attributedString
@@ -1196,7 +1157,7 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
             }
             return cell
         } else if tableView.isEqual(to: self.snapshotTableView) {
-            let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMSnapshotTableViewCell"), owner: self) as! KMSnapshotTableViewCell
+            let cell = tableView.makeView(withIdentifier: KMSnapshotTableViewCell.km_identifier, owner: self) as! KMSnapshotTableViewCell
             var snapshot: KMSnapshotModel?
             if self.isSearchSnapshotMode {
                 snapshot = self.searchSnapshots[row]
@@ -1225,7 +1186,6 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
     func tableView(_ tableView: NSTableView, heightOfRow row: Int) -> CGFloat {
         if tableView.isEqual(to: self.thumbnailTableView) {
             let scaling = KMDataManager.ud_float(forKey: Self.Key.thumbSizeScaling)
-//            let thumbnailSize = self.thumbnails[row].size
             let thumbnailSize = NSMakeSize(self.thumbnailCacheSize, self.thumbnailCacheSize)
             
             let newScaling: CGFloat = scaling.cgFloat + 0.1
@@ -1319,7 +1279,6 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
         } else if self.groupedFindTableView.isEqual(to: notification.object) {
             //            [self updateFindResultHighlightsForDirection:NSDirectSelection];
         } else if self.thumbnailTableView.isEqual(to: notification.object) {
-//            if (mwcFlags.updatingThumbnailSelection == 0) {
             let row = self.thumbnailTableView.selectedRow
             let curPage = self.listView.document.index(for: self.listView.currentPage())
             
@@ -1396,8 +1355,6 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
             let url = NSKeyedUnarchiver.unarchiveObject(with: urlData) as? String
             if url != nil && url != self.listView.document.documentURL.absoluteString {
                 if (pasteboard.availableType(from: [.fileURL]) != nil) {
-                    //                if ([pasteboard availableTypeFromArray:[NSArray arrayWithObject:NSFilenamesPboardType]]){
-                    //                    NSArray *fileNames = [pasteboard propertyListForType:NSFilenamesPboardType];
                     var fileNames = pasteboard.propertyList(forType: .fileURL) as? [String] ?? []
                     if (fileNames.count == 1) {
                         let path = fileNames.first ?? ""
@@ -1421,7 +1378,6 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
                                 }
                             } else {
                                 for i in 0 ..< (pdf?.pageCount ?? 0) {
-                                    //                                    PDFPage *page = [[pdf pageAtIndex:i] copy];
                                     var page = pdf?.page(at: i)
                                     self.listView.document.insertPageObject(page, at: UInt(index))
                                     insertIndexSet.insert(index)
@@ -1452,7 +1408,7 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
                 toPageIndex = Int(self.listView.document.pageCount)
             }
             for i in 0 ..< pages.count {
-                var page = pages[i]
+                let page = pages[i]
                 self.listView.document.insertPageObject(page, at: UInt(toPageIndex+i))
                 pageIndex += 1
                 self.listView.go(toPageIndex: toPageIndex+i, animated: false)
@@ -1476,8 +1432,6 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
                     }
                 }
             }
-            //            [[[[self document] undoManager] prepareWithInvocationTarget:self] undoClick];
-            //            [self.pageLabels setArray:[[self.pdfView document] pageLabels]];
             self.listView.layoutDocumentView()
             self.resetThumbnails()
         } else if pasteboard.availableType(from: [.fileURL]) != nil && tableView.isEqual(to: self.thumbnailTableView) {
@@ -1736,12 +1690,13 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
                     self.listView.document.removePage(at: IndexSet(integer: idx))
                 }
             }
-            self.listView.layoutDocumentView()
-//            [pageLabels setArray:[[pdfView document] pageLabels]];
-            self.resetThumbnails()
-            let idx = rowIndexes.first ?? -1
-            let index = min(idx, Int(self.listView.document.pageCount)-1)
-            self.listView.go(toPageIndex: index, animated: false)
+            if rowIndexes.isEmpty == false {
+                self.listView.layoutDocumentView()
+                self.resetThumbnails()
+                let idx = rowIndexes.first ?? -1
+                let index = min(idx, Int(self.listView.document.pageCount)-1)
+                self.listView.go(toPageIndex: index, animated: false)
+            }
         }
     }
     
@@ -2366,8 +2321,7 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
             } else {
                 note = (item as? KMBOTAAnnotationItem)?.annotation
             }
-            
-            let cell = outlineView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMNoteTableViewCell"), owner: self) as! KMNoteTableViewCell
+            let cell = outlineView.makeView(withIdentifier: KMNoteTableViewCell.km_identifier, owner: self) as! KMNoteTableViewCell
             cell.cellNote = note
             
             let noteColor = note?.color
@@ -2378,11 +2332,9 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
             }
 
             var pageString = "\((note?.page?.pageIndex() ?? 0) + 1)"
-            let formatter = DateFormatter()
-            formatter.dateFormat = "hh:mm"
             var dateString = ""
             if let date = note?.modificationDate() {
-                dateString = formatter.string(from: date)
+                dateString = KMTools.timeString(timeDate: date)
             }
             var authorString = note?.userName() ?? ""
             var noteTextString = note?.string() ?? ""

+ 1 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMSideViewController.swift

@@ -10,9 +10,8 @@ import Cocoa
 class KMSideViewController: NSViewController {
     var isAnimating = false
     var listView : CPDFListView!
-    var mainViewController : KMMainViewController!
+    weak var mainViewController : KMMainViewController?
     
-//    @IBOutlet weak var mainController: KMMainWindowController!
 //    @IBOutlet weak var gradientView: SKGradientView!
     @IBOutlet weak var button: NSSegmentedControl!
     @IBOutlet weak var alternateButton: NSSegmentedControl!

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

@@ -3816,16 +3816,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
             }
         }
         
-        if(type != .ScanOCR) {
-//            if ((self.documentAIViewController?.view.superview) != nil) {
-//                self.listView.isHidden = false
-//                self.documentAIViewController?.creatRecognitionDocument()
-//                self.documentAIViewController?.view .removeFromSuperview()
-//                self.documentAIViewController = nil;
-//                self.listView.layoutDocumentView()
-//            }
-        }
-        
         if(type != .Form) {
             formAlertView?.removeFromSuperview()
             formAlertView = nil
@@ -3837,29 +3827,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
             } else {
                 self.enterPageEdit(pages)
             }
-        } else if(type == .ScanOCR) {
-//            if((self.documentAIViewController?.view.superview) != nil) {
-//                let alert = NSAlert()
-//                alert.messageText = NSLocalizedString("If you need to edit again after exit, you need to re-execute OCR recognition, sure you want to exit?", comment: "")
-//                alert.addButton(withTitle: "YES")
-//                alert.addButton(withTitle: "NO")
-//                let result = alert.runModal()
-//                if (result == .alertFirstButtonReturn) { /// 取消
-//                    self.listView.isHidden = false
-//                    self.documentAIViewController?.creatRecognitionDocument()
-//                    self.documentAIViewController?.view .removeFromSuperview()
-//                    self.documentAIViewController = nil;
-//                    self.listView.layoutDocumentView()
-//                } else {
-//                    self.toolbarController.toolbarType = .ScanOCR
-//                }
-//            } else {
-//                self.documentAIViewController = KMDocumentAIViewController(pdfView: self.listView)
-//                self.PDFContendView.addSubview(self.documentAIViewController?.view ??  KMDocumentAIViewController().view);
-//                self.documentAIViewController?.view.frame = self.PDFContendView.bounds
-//                self.documentAIViewController?.view.autoresizingMask = NSView.AutoresizingMask([.width,.height])
-//                self.listView.isHidden = true //不影藏的话会出现鼠标事件的崩溃
-//            }
         } else if type == .editPDF {
             self.listView.annotationType = .editTextImage
         } else if type == .Annatiton {

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

@@ -1039,7 +1039,7 @@ let LOCKED_KEY  = "locked"
         //选中page
         var tPages = pages
         if tPages.count == 0 {
-            tPages = self.leftSideViewController.selectPages ?? [self.listView.currentPageIndex]
+            tPages = self.leftSideViewController.thumb_fetchSelectedRows() ?? [self.listView.currentPageIndex]
         }
         
         if (hasEnterPageEdit()) {

+ 1 - 0
PDF Office/PDF Master/Class/ToolsLibrary/AppKitCategories/NSImage_SKExtensions.h

@@ -163,6 +163,7 @@ extern NSString *SKImageNameRemoteStateScroll;
 
 + (void)makeImages;
 + (void)makeTextAlignImages;
++ (void)makeAdornImages;
 
 @end
 

+ 10 - 10
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -263,32 +263,32 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "56395C92-3A00-4FEB-947F-91EE3A0B02AA"
+            uuid = "6B9373DD-1A2D-449E-8B52-CAB5C3223C22"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "PDF Master/AppDelegate.swift"
+            filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "310"
-            endingLineNumber = "310"
-            landmarkName = "applicationShouldHandleReopen(_:hasVisibleWindows:)"
+            startingLineNumber = "351"
+            endingLineNumber = "351"
+            landmarkName = "reopenDocument(forPaths:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "6B9373DD-1A2D-449E-8B52-CAB5C3223C22"
+            uuid = "36154C59-B64A-471C-9D94-EF6A55921702"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
+            filePath = "PDF Master/Class/ToolsLibrary/AppKitCategories/NSImage_SKExtensions.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "350"
-            endingLineNumber = "350"
-            landmarkName = "reopenDocument(forPaths:)"
+            startingLineNumber = "1959"
+            endingLineNumber = "1959"
+            landmarkName = "+makeImages"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>