Do not use fullname in compare export - thx Leon :)

Work on #6302
This commit is contained in:
niksedk 2022-10-02 10:04:11 +02:00
parent 221df798d3
commit 113479edbd

View File

@ -1316,9 +1316,9 @@ namespace Nikse.SubtitleEdit.Forms
sb.AppendLine(" <h1>Subtitle Edit compare</h1>"); sb.AppendLine(" <h1>Subtitle Edit compare</h1>");
sb.AppendLine(" <table>"); sb.AppendLine(" <table>");
sb.AppendLine(" <tr>"); sb.AppendLine(" <tr>");
sb.AppendLine(" <th colspan='4' style='text-align:left'>" + labelSubtitle1.Text + "</th>"); sb.AppendLine(" <th colspan='4' style='text-align:left'>" + GetFileName(labelSubtitle1.Text) + "</th>");
sb.AppendLine(" <th>&nbsp;</th>"); sb.AppendLine(" <th>&nbsp;</th>");
sb.AppendLine(" <th colspan='4' style='text-align:left'>" + labelSubtitle2.Text + "</th>"); sb.AppendLine(" <th colspan='4' style='text-align:left'>" + GetFileName(labelSubtitle2.Text) + "</th>");
sb.AppendLine(" </tr>"); sb.AppendLine(" </tr>");
for (var i = 0; i < subtitleListView1.Items.Count; i++) for (var i = 0; i < subtitleListView1.Items.Count; i++)
{ {
@ -1356,6 +1356,11 @@ namespace Nikse.SubtitleEdit.Forms
} }
} }
private static string GetFileName(string fileName)
{
return string.IsNullOrEmpty(fileName) ? string.Empty : Path.GetFileName(fileName);
}
private static string GetHtmlText(Paragraph p, string text) private static string GetHtmlText(Paragraph p, string text)
{ {
return p.IsDefault ? string.Empty : HtmlUtil.EncodeNamed(text); return p.IsDefault ? string.Empty : HtmlUtil.EncodeNamed(text);