Browse Source

【综合】首页 高级编辑工具-页面编辑,选择页面时提示错误(已修复)

tangchao 11 months ago
parent
commit
118b7c0938

+ 4 - 5
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -113,7 +113,7 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
         }
         var item: Int = 0
         if (self.selectedPages.isEmpty) {
-            var index = self.listView?.currentPageIndex ?? 0
+            let index = self.listView?.currentPageIndex ?? 0
             self.selectPages(indexs: IndexSet(integer: index))
             self.toolBar.setPageRangeString("\(index+1)")
             item = index
@@ -1223,9 +1223,8 @@ extension KMPDFEditViewController {
     func km_comboBoxSelectionDidChange(_ obj: KMPageRange) {
         self.pageIsUpdate = false
         
-        let index = obj.rawValue
         var indexpaths: Set<IndexPath> = []
-        var type: KMPageRange? = obj
+        let type: KMPageRange? = obj
         let pageCnt = self.pdfDocument?.pageCount ?? 0
         for i in 0 ..< pageCnt {
             if (type == .all) {
@@ -1255,7 +1254,6 @@ extension KMPDFEditViewController {
             }
         }
         
-//        obj.editable = type == .custom
         if (type == .custom) {
             let windowC = KMPDFEditPageRangeWindowController()
             windowC.pdfDocument = self.pdfDocument
@@ -1264,9 +1262,10 @@ extension KMPDFEditViewController {
                 for page in pagesArray {
                     indexpaths.insert(IndexPath(item: page-1, section: 0))
                 }
+                self?.km_endSheet()
                 
                 self?.selectPages(indexpaths: indexpaths)
-                self?.km_endSheet()
+                self?.thumbnailView.collectionView.scrollToItems(at: indexpaths, scrollPosition: .bottom)
             }
             self.km_beginSheet(windowC: windowC)
             

+ 7 - 2
PDF Office/PDF Master/Class/PDFTools/PageEdit/Window/KMPDFEditPageRangeWindowController.swift

@@ -44,6 +44,9 @@ class KMPDFEditPageRangeWindowController: NSWindowController {
         
         self.fileAttri_ = KMFileAttribute()
         self.fileAttri_?.filePath = self.pdfDocument?.documentURL.path ?? ""
+        if let cnt = self.pdfDocument?.pageCount {
+            self.fileAttri_?.pageCnt = Int(cnt)
+        }
         self.fileAttri_?.bAllPage = false
         self.fileAttri_?.pagesType = .custom
     }
@@ -61,8 +64,10 @@ class KMPDFEditPageRangeWindowController: NSWindowController {
             let alert = NSAlert()
             alert.alertStyle = .critical
             alert.messageText = String(format: "%@ %@", self.pdfDocument?.documentURL.lastPathComponent.lastPathComponent ?? "", KMLocalizedString("Invalid page range or the page number is out of range. Please try again.", nil))
-            alert.runModal()
-            self.window?.makeFirstResponder(self.pageRangeTextField)
+//            alert.runModal()
+            alert.beginSheetModal(for: self.window!) { res in
+                self.window?.makeFirstResponder(self.pageRangeTextField)
+            }
             return
         } else {
             if (self.pageSelectCallBack != nil) {

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

@@ -564,5 +564,69 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "FEBFD498-1FAF-4D15-9D53-F70C16A72C7E"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFTools/PageEdit/Window/KMPDFEditWindowController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "60"
+            endingLineNumber = "60"
+            landmarkName = "endModal(_:)"
+            landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "FEBFD498-1FAF-4D15-9D53-F70C16A72C7E - 89f9717dd7f47f3e"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMPDFEditWindowController.endModal(Swift.Optional&lt;Swift.AnyObject&gt;) -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Master/Class/PDFTools/PageEdit/Window/KMPDFEditWindowController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "60"
+                  endingLineNumber = "60"
+                  offsetFromSymbolStart = "79">
+               </Location>
+               <Location
+                  uuid = "FEBFD498-1FAF-4D15-9D53-F70C16A72C7E - 89f9717dd7f47f3e"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMPDFEditWindowController.endModal(Swift.Optional&lt;Swift.AnyObject&gt;) -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Master/Class/PDFTools/PageEdit/Window/KMPDFEditWindowController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "60"
+                  endingLineNumber = "60"
+                  offsetFromSymbolStart = "104">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "D709AEF9-E2F7-45B8-9385-2CE9A0A35DBF"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/Common/Base/KMBaseWindowController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "17"
+            endingLineNumber = "17"
+            landmarkName = "KMBaseWindowController"
+            landmarkType = "3">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>