Skip to content

Commit

Permalink
!重命名方法名称
Browse files Browse the repository at this point in the history
  • Loading branch information
wmjordan committed Jan 24, 2022
1 parent d7c6cc1 commit 0f65235
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion App/Functions/InfoExchangerControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void PreviewRename(List<SourceItem.Pdf> items, string template) {
continue;
}
else {
t = Processor.Worker.RenameFile(template, item);
t = Processor.Worker.GetExpandedFileName(item, template);
if (t.Length == 0) {
t = "<输出文件名无效>";
}
Expand Down
2 changes: 1 addition & 1 deletion App/Functions/RenameControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private void PreviewRename(List<SourceItem.Pdf> items, string template) {
continue;
}
else {
t = Processor.Worker.RenameFile(template, item);
t = Processor.Worker.GetExpandedFileName(item, template);
if (t.Length == 0) {
t = "<输出文件名无效>";
}
Expand Down
6 changes: 3 additions & 3 deletions App/Processor/Worker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ internal static void ExportInfo(string sourceFile, string targetFile) {

try {
Tracker.TraceMessage("正在导出信息文件。");
if (targetFile.EndsWith(".txt", StringComparison.OrdinalIgnoreCase)) {
if (targetFile.EndsWith(Ext.Txt, StringComparison.OrdinalIgnoreCase)) {
Tracker.SetProgressGoal(50);
using (TextWriter w = new StreamWriter(targetFile, false, AppContext.Exporter.GetEncoding())) {
DocInfoExporter.WriteDocumentInfoAttributes(w, sourceFile, r.NumberOfPages);
Expand Down Expand Up @@ -793,7 +793,7 @@ internal static void Ocr(string sourceFile, string bookmarkFile, OcrOptions opti
}
}

internal static string RenameFile(string template, SourceItem.Pdf item) {
internal static string GetExpandedFileName(SourceItem.Pdf item, string template) {
string t;
var s = item.FilePath;
var d = new PdfDictionary();
Expand Down Expand Up @@ -821,7 +821,7 @@ internal static void RenameFiles(List<SourceItem.Pdf> items, string template, bo
Tracker.TraceMessage(Tracker.Category.Error, String.Concat("找不到 PDF 文件:", s));
continue;
}
var t = RenameFile(template, item);
var t = GetExpandedFileName(item, template);
Tracker.TraceMessage(Tracker.Category.InputFile, s.ToString());
Tracker.TraceMessage(Tracker.Category.OutputFile, t);
Tracker.TraceMessage(Tracker.Category.ImportantMessage, String.Concat("重命名 PDF 文件:", s));
Expand Down

0 comments on commit 0f65235

Please sign in to comment.