Remove dead code in AssFile::CanSave

Originally committed to SVN as r5724.
This commit is contained in:
Thomas Goyne 2011-10-10 17:29:26 +00:00
parent e91834d667
commit eb947b3914

View file

@ -263,15 +263,10 @@ bool AssFile::CanSave() {
SubtitleFormat *writer = SubtitleFormat::GetWriter(filename); SubtitleFormat *writer = SubtitleFormat::GetWriter(filename);
if (!writer) return false; if (!writer) return false;
// Check if format supports timing
bool canTime = true;
//if (filename.Lower().Right(4) == ".txt") canTime = false;
// Scan through the lines // Scan through the lines
AssStyle defstyle; AssStyle defstyle;
AssStyle *curstyle; AssStyle *curstyle;
AssDialogue *curdiag; AssDialogue *curdiag;
AssAttachment *attach;
for (entryIter cur=Line.begin();cur!=Line.end();cur++) { for (entryIter cur=Line.begin();cur!=Line.end();cur++) {
// Check style, if anything non-default is found, return false // Check style, if anything non-default is found, return false
curstyle = dynamic_cast<AssStyle*>(*cur); curstyle = dynamic_cast<AssStyle*>(*cur);
@ -280,14 +275,13 @@ bool AssFile::CanSave() {
} }
// Check for attachments, if any is found, return false // Check for attachments, if any is found, return false
attach = dynamic_cast<AssAttachment*>(*cur); if (dynamic_cast<AssAttachment*>(*cur)) return false;
if (attach) return false;
// Check dialog // Check dialog
curdiag = dynamic_cast<AssDialogue*>(*cur); curdiag = dynamic_cast<AssDialogue*>(*cur);
if (curdiag) { if (curdiag) {
// Timed? // Timed?
if (!canTime && (curdiag->Start.GetMS() != 0 || curdiag->End.GetMS() != 0)) return false; if (curdiag->Start.GetMS() != 0 || curdiag->End.GetMS() != 0) return false;
// Overrides? // Overrides?
curdiag->ParseASSTags(); curdiag->ParseASSTags();