From a34cd6912530417819c91ba312c485ea78f1da0c Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 2 Mar 2020 10:06:16 +0100 Subject: [PATCH] PartDesign: [skip ci] fixes #0004276: Loading a project takes much more time compared to previous versions --- src/Mod/PartDesign/App/FeatureDressUp.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Mod/PartDesign/App/FeatureDressUp.cpp b/src/Mod/PartDesign/App/FeatureDressUp.cpp index 59f748d4cc..d9f332a44e 100644 --- a/src/Mod/PartDesign/App/FeatureDressUp.cpp +++ b/src/Mod/PartDesign/App/FeatureDressUp.cpp @@ -177,7 +177,12 @@ void DressUp::onChanged(const App::Property* prop) BaseFeature.setValue (Base.getValue()); } } else if (prop == &Shape || prop == &SupportTransform) { - if (!isRestoring() && !getDocument()->isPerformingTransaction()) { + // This is an expensive operation and to avoid to perform it unnecessarily it's not sufficient + // to check for the 'Restore' flag of the dress-up feature because at that time it's already reset. + // Instead the 'Restore' flag of the document must be checked. + // For more details see: https://forum.freecadweb.org/viewtopic.php?f=3&t=43799 (and issue 4276) + if (!getDocument()->testStatus(App::Document::Restoring) && + !getDocument()->isPerformingTransaction()) { Part::TopoShape s; auto base = Base::freecad_dynamic_cast(getBaseObject(true)); if(!base) {