From 573e4cd7724feb322699cd8d11e45b9f98526f90 Mon Sep 17 00:00:00 2001 From: Uwe Date: Wed, 30 Mar 2022 02:57:35 +0200 Subject: [PATCH] [FEM] fix bug 4 of the cut filter bugs as reported here: https://forum.freecadweb.org/viewtopic.php?p=584217#p584217 --- src/Mod/Fem/Gui/TaskPostBoxes.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.cpp b/src/Mod/Fem/Gui/TaskPostBoxes.cpp index 391e88b9b1..e64adea952 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.cpp +++ b/src/Mod/Fem/Gui/TaskPostBoxes.cpp @@ -463,12 +463,17 @@ void TaskPostClip::collectImplicitFunctions() { ui->FunctionBox->clear(); QStringList items; + std::size_t currentItem = 0; + App::DocumentObject* currentFunction = static_cast(getObject())->Function.getValue(); const std::vector& funcs = static_cast( pipeline->Functions.getValue())->Functions.getValues(); - for (std::size_t i = 0; i < funcs.size(); ++i) + for (std::size_t i = 0; i < funcs.size(); ++i) { items.push_back(QString::fromLatin1(funcs[i]->getNameInDocument())); - + if (currentFunction = funcs[i]) + currentItem = i; + } ui->FunctionBox->addItems(items); + ui->FunctionBox->setCurrentIndex(currentItem); } } }