[TechDraw] Simplify return logic

This commit is contained in:
Benjamin Bræstrup Sayoc
2023-04-09 16:34:23 +02:00
committed by WandererFan
parent 5d05acc87e
commit 3794897699
14 changed files with 20 additions and 42 deletions

View File

@@ -96,8 +96,7 @@ App::Color LineFormat::getDefEdgeColor()
int LineFormat::getDefEdgeStyle()
{
int style = Preferences::getPreferenceGroup("Decorations")->GetInt("CosmoCLStyle", 2); //dashed
return style;
return Preferences::getPreferenceGroup("Decorations")->GetInt("CosmoCLStyle", 2); //dashed
}
//******************************************

View File

@@ -571,20 +571,18 @@ void DrawView::setScaleAttribute()
int DrawView::prefScaleType()
{
int result = Preferences::getPreferenceGroup("General")->GetInt("DefaultScaleType", 0);
return result;
return Preferences::getPreferenceGroup("General")->GetInt("DefaultScaleType", 0);
}
double DrawView::prefScale()
{
double result = Preferences::getPreferenceGroup("General")->GetFloat("DefaultViewScale", 1.0);
if (ScaleType.isValue("Page")) {
auto page = findParentPage();
if (page) {
result = page->Scale.getValue();
return page->Scale.getValue();
}
}
return result;
return Preferences::getPreferenceGroup("General")->GetFloat("DefaultViewScale", 1.0);
}
void DrawView::requestPaint()

View File

@@ -1192,7 +1192,7 @@ int DrawViewSection::prefCutSurface(void) const
bool DrawViewSection::showSectionEdges(void)
{
return (Preferences::getPreferenceGroup("General")->GetBool("ShowSectionEdges", true));
return Preferences::getPreferenceGroup("General")->GetBool("ShowSectionEdges", true);
}
bool DrawViewSection::trimAfterCut() const { return TrimAfterCut.getValue(); }

View File

@@ -425,7 +425,6 @@ Base::Vector3d ShapeExtractor::getLocation3dFromFeat(App::DocumentObject* obj)
bool ShapeExtractor::prefAdd2d()
{
bool result = Preferences::getPreferenceGroup("General")->GetBool("ShowLoose2d", false);
return result;
return Preferences::getPreferenceGroup("General")->GetBool("ShowLoose2d", false);
}