[TechDraw] Simplify code getting default line weights

This commit is contained in:
Benjamin Bræstrup Sayoc
2022-08-02 14:11:13 +02:00
committed by WandererFan
parent bbbc044934
commit f30c30b06f
12 changed files with 29 additions and 69 deletions

View File

@@ -60,10 +60,7 @@ ViewProviderBalloon::ViewProviderBalloon()
ADD_PROPERTY_TYPE(Font, (Preferences::labelFont().c_str()), group, App::Prop_None, "The name of the font to use");
ADD_PROPERTY_TYPE(Fontsize, (Preferences::dimFontSizeMM()),
group, (App::PropertyType)(App::Prop_None), "Balloon text size in units");
int lgNumber = Preferences::lineGroup();
auto lg = TechDraw::LineGroup::lineGroupFactory(lgNumber);
double weight = lg->getWeight("Thin");
delete lg; //Coverity CID 174670
double weight = TechDraw::LineGroup::getDefaultWidth("Thin");
ADD_PROPERTY_TYPE(LineWidth, (weight), group, (App::PropertyType)(App::Prop_None), "Leader line width");
ADD_PROPERTY_TYPE(LineVisible, (true), group, (App::PropertyType)(App::Prop_None), "Balloon line visible or hidden");
ADD_PROPERTY_TYPE(Color, (PreferencesGui::dimColor()), group, App::Prop_None, "Color of the balloon");