Add new dialogue lines immediately after the last dialogue line in the file rather than at the end of the file
Originally committed to SVN as r4806.
This commit is contained in:
parent
aee6b0a540
commit
ef7abaf1b6
1 changed files with 2 additions and 1 deletions
|
@ -749,8 +749,9 @@ void SubtitlesGrid::SwapLines(int n1,int n2) {
|
||||||
/// @param after
|
/// @param after
|
||||||
/// @param update
|
/// @param update
|
||||||
void SubtitlesGrid::InsertLine(AssDialogue *line,int n,bool after,bool update) {
|
void SubtitlesGrid::InsertLine(AssDialogue *line,int n,bool after,bool update) {
|
||||||
AssDialogue *rel_line = GetDialogue(n + (after?1:0));
|
AssDialogue *rel_line = GetDialogue(n);
|
||||||
entryIter pos = std::find(ass->Line.begin(), ass->Line.end(), rel_line);
|
entryIter pos = std::find(ass->Line.begin(), ass->Line.end(), rel_line);
|
||||||
|
if (after) ++pos;
|
||||||
|
|
||||||
entryIter newIter = ass->Line.insert(pos,line);
|
entryIter newIter = ass->Line.insert(pos,line);
|
||||||
BaseGrid::UpdateMaps();
|
BaseGrid::UpdateMaps();
|
||||||
|
|
Loading…
Reference in a new issue