From 2fc05e2f0d262f1372190e10657ef8506aa9c871 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Thu, 5 Sep 2019 09:36:24 +0800 Subject: [PATCH] App: check active document before revert in Document::restore() --- src/App/Document.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 513418d08c48..d0eb95098da4 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -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); @@ -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)