|
@@ -689,8 +689,10 @@ extension KMNThumbnailBaseViewController {
|
|
|
}
|
|
|
|
|
|
private func insertFilePath(filePath:String,pdfPassword:String?) {
|
|
|
- let selectedIndexPaths = collectionView.selectionIndexPaths
|
|
|
-
|
|
|
+ var selectedIndexPaths = collectionView.selectionIndexPaths
|
|
|
+ if(selectedIndexPaths.count <= 0) {
|
|
|
+ selectedIndexPaths = pdfviewSelectionIndexPaths
|
|
|
+ }
|
|
|
let insertPDF = KMNPDFInsertPDFWindowController(showDocument, filePath: filePath, password: pdfPassword, selectionIndexPaths: selectedIndexPaths)
|
|
|
insertPDF.pdfCallback = { [weak self] fileAttribute, insertIdx in
|
|
|
let doc = fileAttribute.pdfDocument
|
|
@@ -778,7 +780,10 @@ extension KMNThumbnailBaseViewController {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- let selectedIndexPaths = collectionView.selectionIndexPaths
|
|
|
+ var selectedIndexPaths = collectionView.selectionIndexPaths
|
|
|
+ if(selectedIndexPaths.count <= 0) {
|
|
|
+ selectedIndexPaths = pdfviewSelectionIndexPaths
|
|
|
+ }
|
|
|
|
|
|
let insertPDF = KMNPDFInsertBlankWindowController(self.showDocument, selectionIndexPaths: selectedIndexPaths)
|
|
|
insertPDF.callback = { [weak self] pageSize, insertIdx in
|
|
@@ -792,7 +797,10 @@ extension KMNThumbnailBaseViewController {
|
|
|
KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
|
|
|
return
|
|
|
}
|
|
|
- let selectedIndexPaths = collectionView.selectionIndexPaths
|
|
|
+ var selectedIndexPaths = collectionView.selectionIndexPaths
|
|
|
+ if(selectedIndexPaths.count <= 0) {
|
|
|
+ selectedIndexPaths = pdfviewSelectionIndexPaths
|
|
|
+ }
|
|
|
var maxmumIndex = 1
|
|
|
if(selectedIndexPaths.count > 0) {
|
|
|
let maxmumIndexPath = selectedIndexPaths.max(by: { $0 < $1 })
|