|
@@ -213,22 +213,22 @@ extension KMMergeWindowController {
|
|
|
|
|
|
|
|
|
let fileName = (files.first?.filePath.deletingPathExtension.lastPathComponent ?? "") + "_Merged"
|
|
|
- DispatchQueue.main.async {
|
|
|
+// DispatchQueue.main.async {
|
|
|
if self.oldPDFDocument.outlineRoot() == nil {
|
|
|
self.oldPDFDocument.setNewOutlineRoot()
|
|
|
}
|
|
|
if allPage {
|
|
|
-// var insertIndex = 0
|
|
|
-// for i in 0..<rootPDFOutlineArray.count {
|
|
|
-// let rootOutline = rootPDFOutlineArray[i]
|
|
|
-// for j in 0..<rootOutline.numberOfChildren {
|
|
|
-// let outline = rootOutline.child(at: j)
|
|
|
-// if outline != nil {
|
|
|
-// self.oldPDFDocument.outlineRoot().insertChild(outline!, at: UInt(insertIndex))
|
|
|
-// insertIndex = insertIndex + 1
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
+ var insertIndex = 0
|
|
|
+ for i in 0..<rootPDFOutlineArray.count {
|
|
|
+ let rootOutline = rootPDFOutlineArray[i]
|
|
|
+ for j in 0..<rootOutline.numberOfChildren {
|
|
|
+ let outline = rootOutline.child(at: j)
|
|
|
+ if outline != nil {
|
|
|
+ self.oldPDFDocument.outlineRoot().insertChild(outline!, at: UInt(insertIndex))
|
|
|
+ insertIndex = insertIndex + 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
self.handleReDraw()
|
|
@@ -327,7 +327,7 @@ extension KMMergeWindowController {
|
|
|
}
|
|
|
}
|
|
|
// }
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
func fetchAllOfChildren(_ aOutline: CPDFOutline, containerArray aMArray: inout [CPDFOutline]) {
|