Restore filename if "save as" fails

This commit is contained in:
David Capello 2014-07-06 21:29:36 -03:00
parent 6861bd7bb7
commit fa760d8a21

View File

@ -185,6 +185,7 @@ protected:
{
ContextWriter writer(reader);
Document* documentWriter = writer.document();
std::string oldFilename = documentWriter->getFilename();
// Change the document file name
documentWriter->setFilename(filename.c_str());
@ -193,6 +194,9 @@ protected:
// Save the document
save_document_in_background(documentWriter, markAsSaved);
if (documentWriter->isModified())
documentWriter->setFilename(oldFilename);
update_screen_for_document(documentWriter);
}
}