fix init of string

This commit is contained in:
Filip Sykala 2022-03-08 09:28:46 +01:00
parent a6834a1a82
commit f4fc23ce0d

View File

@ -3391,11 +3391,11 @@ std::optional<TextConfiguration> TextConfigurationSerialization::read(const char
std::string weight = get_attribute_value_string(attributes, num_attributes, FONT_WEIGHT_ATTR);
if (!weight.empty()) fp.weight = weight;
std::string font_name = "";
std::string style_name{}; // should store .3mf file name
std::string font_descriptor = get_attribute_value_string(attributes, num_attributes, FONT_DESCRIPTOR_ATTR);
std::string type_str = get_attribute_value_string(attributes, num_attributes, FONT_DESCRIPTOR_TYPE_ATTR);
FontItem::Type type = TextConfigurationSerialization::get_type(type_str);
FontItem fi(font_name, font_descriptor, type, fp);
FontItem fi(style_name, font_descriptor, type, fp);
std::string text = get_attribute_value_string(attributes, num_attributes, TEXT_DATA_ATTR);
return TextConfiguration(fi, text);