|
@@ -3449,6 +3449,23 @@ struct KMNMWCFlags {
|
|
|
listView.updateActiveAnnotations(normalActiveAnnotations)
|
|
|
}
|
|
|
|
|
|
+ @objc func selectAllRedactAnnotation () {
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ listView.updateActiveAnnotations(selectAllRedactAnnotation)
|
|
|
+ listView.setNeedsDisplayForVisiblePages()
|
|
|
+ }
|
|
|
+
|
|
|
//MARK: 搜索 & 替换
|
|
|
func showSearchPopWindow(type: KMNBotaSearchType, keyborad: String?, replaceText: String?, results: [KMSearchMode]) {
|
|
|
let toolMode = self.listView.toolMode
|
|
@@ -5714,6 +5731,11 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
|
|
|
menuStringArr.append(PDFViewMenuIdentifier_Normal_CopyText)
|
|
|
menuStringArr.append(PDFViewMenuIdentifier_Normal_Delete)
|
|
|
menuStringArr.append(PDFViewMenuIdentifier_Space)
|
|
|
+ } else if firstAnnotation?.isKind(of: CPDFRedactAnnotation.self) == true {
|
|
|
+ menuStringArr.append(PDFViewMenuIdentifier_Normal_Delete)
|
|
|
+ menuStringArr.append(PDFViewMenuIdentifier_Space)
|
|
|
+ menuStringArr.append(PDFViewMenuIdentifier_Redact_Apply)
|
|
|
+ menuStringArr.append(PDFViewMenuIdentifier_Redact_Multipage)
|
|
|
} else {
|
|
|
menuStringArr.append(PDFViewMenuIdentifier_Normal_Copy)
|
|
|
menuStringArr.append(PDFViewMenuIdentifier_Normal_Cut)
|
|
@@ -5725,7 +5747,13 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
|
|
|
menuStringArr.append(PDFViewMenuIdentifier_Normal_ShowPopUI)
|
|
|
menuStringArr.append(PDFViewMenuIdentifier_Space)
|
|
|
}
|
|
|
- menuStringArr.append(PDFViewMenuIdentifier_Normal_SortAnnotation)
|
|
|
+
|
|
|
+ if firstAnnotation?.isKind(of: CPDFRedactAnnotation.self) == true {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ menuStringArr.append(PDFViewMenuIdentifier_Normal_SortAnnotation)
|
|
|
+ }
|
|
|
+
|
|
|
if firstAnnotation?.isKind(of: CPDFLinkAnnotation.self) == true || firstAnnotation?.isKind(of: CPDFWidgetAnnotation.self) == true {
|
|
|
menuStringArr.append(PDFViewMenuIdentifier_Space)
|
|
|
menuStringArr.append(PDFViewMenuIdentifier_Normal_Aligning)
|
|
@@ -6656,7 +6684,11 @@ extension KMMainViewController: ComponentGroupDelegate {
|
|
|
}
|
|
|
}
|
|
|
} else if (menuItemProperty?.identifier == PDFViewMenuIdentifier_Normal_SelectAllText) {
|
|
|
- listView.selectAll(nil)
|
|
|
+ if self.listView.toolMode == .CRedactToolMode {
|
|
|
+ self.selectAllRedactAnnotation()
|
|
|
+ } else {
|
|
|
+ listView.selectAll(nil)
|
|
|
+ }
|
|
|
} else if (menuItemProperty?.identifier == PDFViewMenuIdentifier_Normal_AddBook) {
|
|
|
menuItemBookMarkClick_add(sender: nil)
|
|
|
} else if(menuItemProperty?.identifier == PDFViewMenuIdentifier_Normal_TextTool) {
|