|
@@ -1162,7 +1162,12 @@ namespace PDF_Master.ViewModels.PageEdit
|
|
|
/// 剪切
|
|
|
/// </summary>
|
|
|
private void cut()
|
|
|
- {
|
|
|
+ {
|
|
|
+ //没有权限时,拦截剪切操作
|
|
|
+ if (!viewContentViewModel.CheckPermissionBeforeOption())
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
CacheFilePath.Instance.CopyDoc = null;
|
|
|
CacheFilePath.Instance.CopyDoc = CPDFDocument.CreateDocument();
|
|
|
List<int> pages = new List<int>();
|
|
@@ -1191,23 +1196,17 @@ namespace PDF_Master.ViewModels.PageEdit
|
|
|
/// </summary>
|
|
|
private void copy()
|
|
|
{
|
|
|
- if(!viewContentViewModel.IAPBeforeFunction())
|
|
|
+ if (!viewContentViewModel.IAPBeforeFunction())
|
|
|
{
|
|
|
return;
|
|
|
- }
|
|
|
-
|
|
|
- VerifyPasswordResult verifyResult = SecurityHelper.VerifyPasswordForSelectedPermissions(PDFViewer.Document, EnumPermissionsSet.StatusAllowsCopying, dialogs);
|
|
|
- if (verifyResult.IsDiscryptied)
|
|
|
- {
|
|
|
- if (verifyResult.Password != null)
|
|
|
- {
|
|
|
- PDFViewer.Document.CheckOwnerPassword(verifyResult.Password);
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
+ if (viewContentViewModel.CheckPermissionBeforeOption())
|
|
|
+ {
|
|
|
CacheFilePath.Instance.CopyDoc = null;
|
|
|
CacheFilePath.Instance.CopyDoc = CPDFDocument.CreateDocument();
|
|
|
List<int> pages = new List<int>();
|
|
|
- if(isMultiSelected)
|
|
|
+ if (isMultiSelected)
|
|
|
{
|
|
|
//确认是多选了页面时,通过页面的选中状态获取选中页面
|
|
|
for (int i = 0; i < PageEditItems.Count; i++)
|
|
@@ -1222,8 +1221,8 @@ namespace PDF_Master.ViewModels.PageEdit
|
|
|
{
|
|
|
//没有多选时,根据listbox的选中索引获取选中页面
|
|
|
pages.Add(ListSelectedIndex);
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
bool result = CacheFilePath.Instance.CopyDoc.ImportPages(PDFViewer.Document, String.Join(",", pages));
|
|
|
if (!result)
|
|
|
{
|
|
@@ -1231,11 +1230,6 @@ namespace PDF_Master.ViewModels.PageEdit
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- ShowToast("复制失败");
|
|
|
- return;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|