|
@@ -208,8 +208,9 @@ class KMOutlineViewController: NSViewController,NSMenuItemValidation {
|
|
|
__NSBeep()
|
|
|
} else {
|
|
|
let currentPDFOutline = self.outlineView.item(atRow: selectedRowIndexes.last!) as! CPDFOutline
|
|
|
- let parent = currentPDFOutline.parent
|
|
|
+ var parent = currentPDFOutline.parent
|
|
|
let index = NSInteger(parent!.index) + 1
|
|
|
+ parent = parent?.parent
|
|
|
if parent != nil {
|
|
|
self.addPDFOutlineToIndex(index: index, atParent: parent)
|
|
|
} else {
|
|
@@ -320,10 +321,10 @@ class KMOutlineViewController: NSViewController,NSMenuItemValidation {
|
|
|
}
|
|
|
|
|
|
func renamePDFOutline(outline : CPDFOutline! , label:String) {
|
|
|
+ self.renameTextField.isEditable = false
|
|
|
if outline.label == label {
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
outline.label = label
|
|
|
self.outlineView.reloadData()
|
|
|
|
|
@@ -390,6 +391,9 @@ class KMOutlineViewController: NSViewController,NSMenuItemValidation {
|
|
|
for i in 0..<numRows {
|
|
|
let tPDFOutline = self.outlineView.item(atRow: i) as! CPDFOutline
|
|
|
let tPage = tPDFOutline.destination.pageIndex
|
|
|
+ if tPage < 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
var page = self.listView.document.page(at: UInt(tPage))!
|
|
|
var tDict : [String : CPDFPage] = ["\(i)":page]
|
|
|
arr.append(tDict)
|