Gui: [skip ci] reformat code
This commit is contained in:
@@ -633,24 +633,27 @@ bool MainWindow::closeAllDocuments (bool close)
|
||||
auto docs = App::GetApplication().getDocuments();
|
||||
try {
|
||||
docs = App::Document::getDependentDocuments(docs, true);
|
||||
}catch(Base::Exception &e) {
|
||||
}
|
||||
catch(Base::Exception &e) {
|
||||
e.ReportException();
|
||||
}
|
||||
|
||||
bool checkModify = true;
|
||||
bool saveAll = false;
|
||||
int failedSaves = 0;
|
||||
for(auto doc : docs) {
|
||||
|
||||
for (auto doc : docs) {
|
||||
auto gdoc = Application::Instance->getDocument(doc);
|
||||
if(!gdoc)
|
||||
if (!gdoc)
|
||||
continue;
|
||||
if(!gdoc->canClose(false))
|
||||
if (!gdoc->canClose(false))
|
||||
return false;
|
||||
if(!gdoc->isModified()
|
||||
if (!gdoc->isModified()
|
||||
|| doc->testStatus(App::Document::PartialDoc)
|
||||
|| doc->testStatus(App::Document::TempDoc))
|
||||
continue;
|
||||
bool save = saveAll;
|
||||
if(!save && checkModify) {
|
||||
if (!save && checkModify) {
|
||||
int res = confirmSave(doc->Label.getStrValue().c_str(), this, docs.size()>1);
|
||||
switch (res)
|
||||
{
|
||||
@@ -666,7 +669,7 @@ bool MainWindow::closeAllDocuments (bool close)
|
||||
}
|
||||
}
|
||||
|
||||
if(save && !gdoc->save())
|
||||
if (save && !gdoc->save())
|
||||
failedSaves++;
|
||||
}
|
||||
|
||||
@@ -681,9 +684,9 @@ bool MainWindow::closeAllDocuments (bool close)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(close)
|
||||
if (close)
|
||||
App::GetApplication().closeAllDocuments();
|
||||
// d->mdiArea->closeAllSubWindows();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user