[TechDraw] Simplify return logic

Normal warmup
This commit is contained in:
Benjamin Bræstrup Sayoc
2023-04-09 19:03:50 +02:00
committed by WandererFan
parent 70c9cf0fc0
commit 3f81006ac4
16 changed files with 164 additions and 238 deletions

View File

@@ -207,13 +207,11 @@ void DrawView::handleXYLock()
short DrawView::mustExecute() const
{
short result = 0;
if (!isRestoring()) {
result = (Scale.isTouched() ||
ScaleType.isTouched());
}
if ((bool) result) {
return result;
if (Scale.isTouched() ||
ScaleType.isTouched()) {
return true;
}
}
return App::DocumentObject::mustExecute();
}
@@ -357,16 +355,15 @@ DrawViewClip* DrawView::getClipGroup()
{
std::vector<App::DocumentObject*> parent = getInList();
App::DocumentObject* obj = nullptr;
DrawViewClip* result = nullptr;
for (std::vector<App::DocumentObject*>::iterator it = parent.begin(); it != parent.end(); ++it) {
if ((*it)->getTypeId().isDerivedFrom(DrawViewClip::getClassTypeId())) {
obj = (*it);
result = dynamic_cast<DrawViewClip*>(obj);
break;
DrawViewClip* result = dynamic_cast<DrawViewClip*>(obj);
return result;
}
}
return result;
return nullptr;
}
double DrawView::autoScale() const