PD: modernize C++: use range-based for loop

This commit is contained in:
wmayer
2023-08-15 17:30:08 +02:00
committed by Chris Hennes
parent c311bab053
commit 9a1f8a11d6
30 changed files with 126 additions and 132 deletions

View File

@@ -50,11 +50,10 @@ void MultiTransform::positionBySupport()
{
PartDesign::Transformed::positionBySupport();
std::vector<App::DocumentObject*> transFeatures = Transformations.getValues();
for (std::vector<App::DocumentObject*>::const_iterator f = transFeatures.begin();
f != transFeatures.end(); ++f) {
if (!((*f)->getTypeId().isDerivedFrom(PartDesign::Transformed::getClassTypeId())))
for (auto f : transFeatures) {
if (!(f->getTypeId().isDerivedFrom(PartDesign::Transformed::getClassTypeId())))
throw Base::TypeError("Transformation features must be subclasses of Transformed");
PartDesign::Transformed* transFeature = static_cast<PartDesign::Transformed*>(*f);
PartDesign::Transformed* transFeature = static_cast<PartDesign::Transformed*>(f);
transFeature->Placement.setValue(this->Placement.getValue());
// To avoid that a linked transform feature stays touched after a recompute