mirror of https://github.com/odrling/Aegisub
Get the end time of the last line in a less dumb way
This commit is contained in:
parent
f7532ff1ef
commit
d3484e7382
|
@ -40,7 +40,6 @@
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
|
||||||
#include <boost/range/adaptor/reversed.hpp>
|
|
||||||
#include <wx/xml/xml.h>
|
#include <wx/xml/xml.h>
|
||||||
|
|
||||||
DEFINE_EXCEPTION(TTXTParseError, SubtitleFormatParseError);
|
DEFINE_EXCEPTION(TTXTParseError, SubtitleFormatParseError);
|
||||||
|
@ -258,10 +257,8 @@ void TTXTSubtitleFormat::ConvertToTTXT(AssFile &file) const {
|
||||||
|
|
||||||
// Find last line
|
// Find last line
|
||||||
AssTime lastTime;
|
AssTime lastTime;
|
||||||
for (auto const& line : file.Events | boost::adaptors::reversed) {
|
if (!file.Events.empty())
|
||||||
lastTime = line.End;
|
lastTime = file.Events.back().End;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Insert blank line at the end
|
// Insert blank line at the end
|
||||||
auto diag = new AssDialogue;
|
auto diag = new AssDialogue;
|
||||||
|
|
Loading…
Reference in New Issue