Browse Source

【优化】 禅道测试问题修复 - 展开BOTA前提下,编辑PDF删除内容后,退出,未刷新缩略图

http://101.132.103.13:7788/zentao/bug-view-5217.html
lizhe 6 months ago
parent
commit
3988c59804

+ 4 - 0
PDF Office/PDF Master/Class/PDFTools/EditPDF/Tools/KMEditPDfHanddler.swift

@@ -120,6 +120,10 @@ class KMEditPDfHanddler: NSObject {
             self.listView?.updateActiveAnnotations([])
             self.listView?.setNeedsDisplayForVisiblePages()
             self.listView?.commitEditFormText()
+            self.listView?.layoutDocumentView()
+            KMThumbnailCache.shared.clearCache()
+            NotificationCenter.default.post(name: NSNotification.Name.init(rawValue: "CPDFDocumentPageCountChangedNotification"), object: self.listView?.document)
+            
             self.closeRightPane()
             
             self.clearData()

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Merge/View/KMPDFThumbnialPageView.swift

@@ -66,7 +66,7 @@ class KMPDFThumbnialPageView: NSView {
         let path = page?.document.documentURL.path ?? ""
         let id = "\(String(describing: pageIndex)) + \(self.bounds)"
         let image = KMThumbnailCache.shared.thumbnail(for: path, id: id)
-        if image != nil {
+        if image != nil && !needReset {
             self.pageImageIv.image = image
         } else {
             self.page?.thumbnail(of: self.bounds.size, needReset: needReset, completion: { [unowned self] image in

+ 3 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift

@@ -689,17 +689,19 @@ extension KMLeftSideViewController {
     }
     
     public func refreshUIForAnnoAttributeDidChange(_ anno: CPDFAnnotation?, attributes: [String : Any]?) {
+        self.updateThumbnail(at: Int(anno?.page?.pageIndex() ?? 0))
         let need = self._annoList_needRefreshUI(annos: anno != nil ? [anno!] : [])
         if need == false {
             return
         }
-        self.updateThumbnail(at: Int(anno?.page?.pageIndex() ?? 0))
         if let data = anno {
             self.note_reloadDataForAnnoIfNeed(anno: data)
         }
     }
     
     public func annoList_refreshUIForDeleteAnnotations(annos: [CPDFAnnotation]?, page: CPDFPage?) {
+        self.updateThumbnail(at: Int(page?.pageIndex() ?? 0))
+        
         if self.type.methodType != .Annotation {
             return
         }

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

@@ -2167,6 +2167,8 @@ import Cocoa
         }
         //刷新前一页后一页按钮
         self.updateNextAndPreViousButtonState()
+        
+        self.leftSideViewController.refreshUIForAnnoAttributeDidChange(nil, attributes: nil)
     }
     
     func CEditPDFToolModeChangeStateUnkownNotification(_ sender: Notification) {