|
@@ -245,11 +245,11 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
|
|
|
{
|
|
|
foreach (var item in listView.ItemsSource)
|
|
|
{
|
|
|
- var pagerange= listView.ItemContainerGenerator.ContainerFromItem(item) as ListViewItem;
|
|
|
- if (pagerange != null)
|
|
|
+ var pagerange = listView.ItemContainerGenerator.ContainerFromItem(item) as ListViewItem;
|
|
|
+ if (pagerange != null)
|
|
|
{
|
|
|
- var pagerangecombobox= CommonHelper.FindVisualChild<WritableComboBox>(pagerange);
|
|
|
- if(pagerangecombobox!=null)
|
|
|
+ var pagerangecombobox = CommonHelper.FindVisualChild<WritableComboBox>(pagerange);
|
|
|
+ if (pagerangecombobox != null)
|
|
|
pagerangecombobox.IsloseFocus = false;
|
|
|
}
|
|
|
}
|
|
@@ -326,8 +326,8 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
|
|
|
}
|
|
|
|
|
|
private void Merge()
|
|
|
- {
|
|
|
-
|
|
|
+ {
|
|
|
+
|
|
|
bool result = true;
|
|
|
CPDFDocument SaveDoc = CPDFDocument.CreateDocument();
|
|
|
|
|
@@ -341,7 +341,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
for (int i = 0; i < MergeObjectlist.Count; i++)
|
|
|
{
|
|
|
if (MergeObjectlist[i].SetPageRange == null)
|
|
@@ -350,8 +350,8 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
|
|
|
alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
|
|
|
}
|
|
|
|
|
|
- //图片
|
|
|
- if (Path.GetExtension(MergeObjectlist[i].FilePath).Trim().ToLower() != ".pdf")
|
|
|
+ //图片
|
|
|
+ if (Path.GetExtension(MergeObjectlist[i].FilePath).Trim().ToLower() != ".pdf")
|
|
|
{
|
|
|
if (Path.GetExtension(MergeObjectlist[i].FilePath).Trim().ToLower() == ".gif")
|
|
|
{//GIF下面方法产生虚影改成与图片转PDF一致
|
|
@@ -366,7 +366,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
|
|
|
try { if (File.Exists(tempFileName)) File.Delete(tempFileName); }
|
|
|
catch
|
|
|
{ }
|
|
|
- if (!result)
|
|
|
+ if (!result)
|
|
|
{
|
|
|
SaveDoc.Release();
|
|
|
return;
|
|
@@ -651,7 +651,12 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- VerifyPasswordResult condition = SecurityHelper.VerifyPasswordByPasswordKind(doc, EnumPasswordKind.StatusPermissionsPassword, dialogs);
|
|
|
+ VerifyPasswordResult condition = new VerifyPasswordResult();
|
|
|
+ //切换一下UI线程,避免解密弹窗异常
|
|
|
+ App.Current.Dispatcher.Invoke(() =>
|
|
|
+ {
|
|
|
+ condition = SecurityHelper.VerifyPasswordByPasswordKind(doc, EnumPasswordKind.StatusPermissionsPassword, dialogs);
|
|
|
+ });
|
|
|
if (condition.IsDiscryptied)
|
|
|
{
|
|
|
if (condition.Password != null)
|
|
@@ -668,6 +673,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
|
|
|
doc.Release();
|
|
|
continue;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
mergeObject.DocName = doc.FileName;
|