From e70170dbf30e80fb926be5978be7b2dc0be077ac Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 28 Feb 2022 17:54:25 +0100 Subject: [PATCH] App: [skip ci] Add enum value to suppress error messages on document recompute --- src/App/Document.cpp | 10 ++++++---- src/App/Document.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 2008b13e8b..12e9a1eb08 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -3571,13 +3571,15 @@ int Document::recompute(const std::vector &objs, bool forc FC_TIME_LOG(t,"Recompute total"); - if(d->_RecomputeLog.size()) { + if (d->_RecomputeLog.size()) { d->pendingRemove.clear(); - Base::Console().Error("Recompute failed! Please check report view.\n"); - } else { + if (!testStatus(Status::IgnoreErrorOnRecompute)) + Base::Console().Error("Recompute failed! Please check report view.\n"); + } + else { for(auto &o : d->pendingRemove) { auto obj = o.getObject(); - if(obj) + if (obj) obj->getDocument()->removeObject(obj->getNameInDocument()); } } diff --git a/src/App/Document.h b/src/App/Document.h index 1ae1844fd6..8602448766 100644 --- a/src/App/Document.h +++ b/src/App/Document.h @@ -71,6 +71,7 @@ public: TempDoc = 9, // Mark as temporary document without prompt for save RestoreError = 10, LinkStampChanged = 11, // Indicates during restore time if any linked document's time stamp has changed + IgnoreErrorOnRecompute = 12, // Don't report errors if the recompute failed }; /** @name Properties */