Gui: do not prompt when closing view of temp document

This commit is contained in:
Zheng, Lei
2020-04-24 16:06:01 +08:00
committed by Chris Hennes
parent 21903a1f41
commit 4d82c5d319
2 changed files with 6 additions and 0 deletions

View File

@@ -1989,6 +1989,9 @@ bool Document::canClose (bool checkModify, bool checkLink)
if (checkLink && App::PropertyXLink::getDocumentInList(getDocument()).size())
return true;
if (getDocument()->testStatus(App::Document::TempDoc))
return true;
bool ok = true;
if (checkModify && isModified() && !getDocument()->testStatus(App::Document::PartialDoc)) {
const char *docName = getDocument()->Label.getValue();

View File

@@ -183,6 +183,9 @@ bool MDIView::onHasMsg(const char* pMsg) const
bool MDIView::canClose(void)
{
if (getAppDocument() && getAppDocument()->testStatus(App::Document::TempDoc))
return true;
if (!bIsPassive && getGuiDocument() && getGuiDocument()->isLastView()) {
this->setFocus(); // raises the view to front
return (getGuiDocument()->canClose(true,true));