From 7839099fea0167ac838c58607724e183a409b006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Rheinl=C3=A4nder?= Date: Sun, 15 Dec 2013 21:46:24 +0100 Subject: [PATCH] Fix bug in PartDesign conversion that choked on unconsumed sketches --- src/Mod/PartDesign/Gui/Workbench.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Workbench.cpp b/src/Mod/PartDesign/Gui/Workbench.cpp index b43220610..021875d3c 100644 --- a/src/Mod/PartDesign/Gui/Workbench.cpp +++ b/src/Mod/PartDesign/Gui/Workbench.cpp @@ -155,18 +155,8 @@ void switchToDocument(const App::Document* doc) std::set inList; inList.insert(*r); // start with the root feature std::vector bodyFeatures; - bodyFeatures.push_back(*r); std::string modelString = ""; do { - std::set newInList; - for (std::set::const_iterator o = inList.begin(); o != inList.end(); o++) { - // Omit members of a MultiTransform from the inList, to avoid migration errors - if (PartDesign::Body::isMemberOfMultiTransform(*o)) - continue; - std::vector iL = doc->getInList(*o); - newInList.insert(iL.begin(), iL.end()); - } - inList = newInList; // TODO: Memory leak? Unnecessary copying? for (std::set::const_iterator o = inList.begin(); o != inList.end(); o++) { std::vector::iterator feat = std::find(features.begin(), features.end(), *o); if (feat != features.end()) { @@ -179,6 +169,15 @@ void switchToDocument(const App::Document* doc) QObject::tr("' and make sure that the migration result is what you would expect.")); } } + std::set newInList; + for (std::set::const_iterator o = inList.begin(); o != inList.end(); o++) { + // Omit members of a MultiTransform from the inList, to avoid migration errors + if (PartDesign::Body::isMemberOfMultiTransform(*o)) + continue; + std::vector iL = doc->getInList(*o); + newInList.insert(iL.begin(), iL.end()); + } + inList = newInList; // TODO: Memory leak? Unnecessary copying? } while (!inList.empty()); if (!modelString.empty()) {