Fix a case where Recombine Lines would leave an empty line

If a "1, 1+2, 1" pattern appeared at the end of the selection the blank
line at the end would never get cleaned up as it's removed when the line
after it is checked for recombination, so add a special case for that.

Closes #1468.

Originally committed to SVN as r6669.
This commit is contained in:
Thomas Goyne 2012-04-06 15:50:54 +00:00
parent 3403734c00
commit 5f00eb62f4
1 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,12 @@ void SubtitlesGrid::RecombineLines() {
context->ass->Line.remove(d1);
continue;
}
// If d2 is the last line in the selection it'll never hit the above test
if (d2 == end && (*d2)->Text.empty()) {
delete *d2;
context->ass->Line.remove(*d2);
continue;
}
// 1, 1+2
while (d2 <= end && (*d2)->Text.StartsWith(d1->Text, &(*d2)->Text)) {