|
@@ -3307,6 +3307,8 @@ struct KMNMWCFlags {
|
|
|
|
|
|
//MARK: - 新增大纲
|
|
|
@objc func addOutLineItemAction() {
|
|
|
+ toggleOpenLeftSide(pdfSideBarType: .outline)
|
|
|
+
|
|
|
botaViewController?.outlineViewC.addOutline()
|
|
|
}
|
|
|
|
|
@@ -3391,7 +3393,7 @@ struct KMNMWCFlags {
|
|
|
var formActiveAnnotations:[CPDFAnnotation] = []
|
|
|
for i in 0 ..< listView.document.pageCount {
|
|
|
let page = listView.document.page(at: i)
|
|
|
- if(page?.pageIndex() = currentPage.pageIndex()) {
|
|
|
+ if(page?.pageIndex() == currentPage.pageIndex()) {
|
|
|
let annotations = page?.annotations
|
|
|
for j in 0 ..< (annotations?.count ?? 0) {
|
|
|
if let an = annotations?[j] as? CPDFAnnotation {
|
|
@@ -3409,7 +3411,7 @@ struct KMNMWCFlags {
|
|
|
var normalActiveAnnotations:[CPDFAnnotation] = []
|
|
|
for i in 0 ..< listView.document.pageCount {
|
|
|
let page = listView.document.page(at: i)
|
|
|
- if(page?.pageIndex() = currentPage.pageIndex()) {
|
|
|
+ if(page?.pageIndex() == currentPage.pageIndex()) {
|
|
|
let annotations = page?.annotations
|
|
|
for j in 0 ..< (annotations?.count ?? 0) {
|
|
|
if let an = annotations?[j] as? CPDFAnnotation {
|
|
@@ -3426,15 +3428,18 @@ struct KMNMWCFlags {
|
|
|
listView.updateActiveAnnotations(normalActiveAnnotations)
|
|
|
}
|
|
|
|
|
|
- @objc func selectAllRedactAnnotation () {
|
|
|
+ @objc func selectAllRedactAnnotation (currentPage:CPDFPage) {
|
|
|
var selectAllRedactAnnotation: [CPDFAnnotation] = []
|
|
|
for i in 0 ..< listView.document.pageCount {
|
|
|
let page = listView.document.page(at: i)
|
|
|
- let annotations = page?.annotations
|
|
|
- for j in 0 ..< (annotations?.count ?? 0) {
|
|
|
- if let an = annotations?[j] as? CPDFAnnotation {
|
|
|
- if an.isKind(of: CPDFRedactAnnotation.self) == true {
|
|
|
- selectAllRedactAnnotation.append(an)
|
|
|
+ if(page?.pageIndex() == currentPage.pageIndex()) {
|
|
|
+
|
|
|
+ let annotations = page?.annotations
|
|
|
+ for j in 0 ..< (annotations?.count ?? 0) {
|
|
|
+ if let an = annotations?[j] as? CPDFAnnotation {
|
|
|
+ if an.isKind(of: CPDFRedactAnnotation.self) == true {
|
|
|
+ selectAllRedactAnnotation.append(an)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -6846,7 +6851,18 @@ extension KMMainViewController: ComponentGroupDelegate {
|
|
|
}
|
|
|
} else if (menuItemProperty?.identifier == PDFViewMenuIdentifier_Normal_SelectAllText) {
|
|
|
if self.listView.toolMode == .CRedactToolMode {
|
|
|
- self.selectAllRedactAnnotation()
|
|
|
+ if let dic = menuItemProperty?.representedObject as? NSDictionary {
|
|
|
+ let objectListView = dic["Object"] as? CPDFListView
|
|
|
+ let theEvent = dic["theEvent"] as? NSEvent
|
|
|
+
|
|
|
+ if(objectListView != nil && theEvent != nil) {
|
|
|
+ var pagePoint = CGPoint.zero
|
|
|
+ if let page = objectListView?.pageAndPoint(&pagePoint, for: theEvent, nearest: false) {
|
|
|
+
|
|
|
+ self.selectAllRedactAnnotation(currentPage: page)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
listView.selectAll(nil)
|
|
|
}
|