Skip to content

Commit

Permalink
App: check active document before revert in Document::restore()
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder authored and wwmayer committed Sep 7, 2019
1 parent 636f5e9 commit 2fc05e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/App/Document.cpp
Expand Up @@ -2372,6 +2372,7 @@ void Document::restore (const char *filename,
d->activeObject = 0;

bool signal = false;
Document *activeDoc = GetApplication().getActiveDocument();
if(d->objectArray.size()) {
signal = true;
GetApplication().signalDeleteDocument(*this);
Expand All @@ -2396,7 +2397,8 @@ void Document::restore (const char *filename,

if(signal) {
GetApplication().signalNewDocument(*this,true);
GetApplication().setActiveDocument(this);
if(activeDoc == this)
GetApplication().setActiveDocument(this);
}

if(!filename)
Expand Down

0 comments on commit 2fc05e2

Please sign in to comment.