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

View file

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