Fix #701, make sure plain-text lines pasted from clipboard are always blank-timed, ie. start and end time are zero.

Originally committed to SVN as r2202.
This commit is contained in:
Niels Martin Hansen 2008-06-15 13:18:28 +00:00
parent 51a16f823e
commit ff081c0ae9
1 changed files with 6 additions and 0 deletions

View File

@ -940,11 +940,17 @@ void SubtitlesGrid::PasteLines(int n,bool pasteOver) {
curdata.Trim(false);
AssDialogue *curdiag;
try {
// Try to interpret the line as an ASS line
curdiag = new AssDialogue(curdata);
}
catch (...) {
// Line didn't parse correcly, assume it's plain text that
// should be pasted in the Text field only
curdiag = new AssDialogue();
curdiag->Text = curdata;
// Make sure pasted plain-text lines always are blank-timed
curdiag->Start.SetMS(0);
curdiag->End.SetMS(0);
}
// Paste over