mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-29 09:23:32 +00:00
Restore filename if "save as" fails
This commit is contained in:
parent
6861bd7bb7
commit
fa760d8a21
@ -185,6 +185,7 @@ protected:
|
|||||||
{
|
{
|
||||||
ContextWriter writer(reader);
|
ContextWriter writer(reader);
|
||||||
Document* documentWriter = writer.document();
|
Document* documentWriter = writer.document();
|
||||||
|
std::string oldFilename = documentWriter->getFilename();
|
||||||
|
|
||||||
// Change the document file name
|
// Change the document file name
|
||||||
documentWriter->setFilename(filename.c_str());
|
documentWriter->setFilename(filename.c_str());
|
||||||
@ -193,6 +194,9 @@ protected:
|
|||||||
// Save the document
|
// Save the document
|
||||||
save_document_in_background(documentWriter, markAsSaved);
|
save_document_in_background(documentWriter, markAsSaved);
|
||||||
|
|
||||||
|
if (documentWriter->isModified())
|
||||||
|
documentWriter->setFilename(oldFilename);
|
||||||
|
|
||||||
update_screen_for_document(documentWriter);
|
update_screen_for_document(documentWriter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user