[PD] Fixed loft and sweep breaking on section deletion

Item removal in `onDeleteSection()` was also clearing subname details so if one
of the remaining sections was a face this caused a failure.
This commit is contained in:
Ajinkya Dahale
2021-11-08 21:20:16 -05:00
committed by Uwe
parent 03a8ff7841
commit 314ff0053c
2 changed files with 10 additions and 4 deletions

View File

@@ -212,6 +212,8 @@ bool TaskLoftParameters::referenceSelected(const Gui::SelectionChanges& msg) con
}
else if (selectionMode == refRemove) {
if (f != refs.end())
// Removing just the object this way instead of `refs.erase` and
// `setValues(ref)` cleanly ensures subnames are preserved.
loft->Sections.removeValue(obj);
else
return false;
@@ -250,8 +252,9 @@ void TaskLoftParameters::onDeleteSection()
App::DocumentObject* obj = loft->getDocument()->getObject(data.constData());
std::vector<App::DocumentObject*>::iterator f = std::find(refs.begin(), refs.end(), obj);
if (f != refs.end()) {
refs.erase(f);
loft->Sections.setValues(refs);
// Removing just the object this way instead of `refs.erase` and
// `setValues(ref)` cleanly ensures subnames are preserved.
loft->Sections.removeValue(obj);
//static_cast<ViewProviderLoft*>(vp)->highlightReferences(false, true);
recomputeFeature();