mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Fix "Join" with append issues - thx Henrique :)
Do not auto-sort when adding files in append mode
This commit is contained in:
parent
a76e20f721
commit
94d12b0c54
@ -176,21 +176,25 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
JoinedFormat = lastFormat;
|
||||
|
||||
for (int outer = 0; outer < subtitles.Count; outer++)
|
||||
{
|
||||
for (int inner = 1; inner < subtitles.Count; inner++)
|
||||
{
|
||||
var a = subtitles[inner - 1];
|
||||
var b = subtitles[inner];
|
||||
if (a.Paragraphs.Count > 0 && b.Paragraphs.Count > 0 && a.Paragraphs[0].StartTime.TotalMilliseconds > b.Paragraphs[0].StartTime.TotalMilliseconds)
|
||||
{
|
||||
string t1 = _fileNamesToJoin[inner - 1];
|
||||
_fileNamesToJoin[inner - 1] = _fileNamesToJoin[inner];
|
||||
_fileNamesToJoin[inner] = t1;
|
||||
|
||||
var t2 = subtitles[inner - 1];
|
||||
subtitles[inner - 1] = subtitles[inner];
|
||||
subtitles[inner] = t2;
|
||||
if (!radioButtonJoinAddTime.Checked)
|
||||
{
|
||||
for (int outer = 0; outer < subtitles.Count; outer++)
|
||||
{
|
||||
for (int inner = 1; inner < subtitles.Count; inner++)
|
||||
{
|
||||
var a = subtitles[inner - 1];
|
||||
var b = subtitles[inner];
|
||||
if (a.Paragraphs.Count > 0 && b.Paragraphs.Count > 0 && a.Paragraphs[0].StartTime.TotalMilliseconds > b.Paragraphs[0].StartTime.TotalMilliseconds)
|
||||
{
|
||||
string t1 = _fileNamesToJoin[inner - 1];
|
||||
_fileNamesToJoin[inner - 1] = _fileNamesToJoin[inner];
|
||||
_fileNamesToJoin[inner] = t1;
|
||||
|
||||
var t2 = subtitles[inner - 1];
|
||||
subtitles[inner - 1] = subtitles[inner];
|
||||
subtitles[inner] = t2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -338,6 +342,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
numericUpDownAddMs.Enabled = radioButtonJoinAddTime.Checked;
|
||||
labelAddTime.Enabled = radioButtonJoinAddTime.Checked;
|
||||
SortAndLoad();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user