mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 05:37:52 -06:00
Fixed return value for deserialize() implementations. #3250
This commit is contained in:
parent
b9127e163b
commit
6e5938c833
2 changed files with 12 additions and 5 deletions
|
@ -87,7 +87,8 @@ class ConfigOptionFloat : public ConfigOptionSingle<double>
|
|||
|
||||
bool deserialize(std::string str) {
|
||||
std::istringstream iss(str);
|
||||
return iss >> this->value;
|
||||
iss >> this->value;
|
||||
return !iss.fail();
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -145,7 +146,8 @@ class ConfigOptionInt : public ConfigOptionSingle<int>
|
|||
|
||||
bool deserialize(std::string str) {
|
||||
std::istringstream iss(str);
|
||||
return iss >> this->value;
|
||||
iss >> this->value;
|
||||
return !iss.fail();
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -268,7 +270,8 @@ class ConfigOptionPercent : public ConfigOptionFloat
|
|||
bool deserialize(std::string str) {
|
||||
// don't try to parse the trailing % since it's optional
|
||||
std::istringstream iss(str);
|
||||
return iss >> this->value;
|
||||
iss >> this->value;
|
||||
return !iss.fail();
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -307,7 +310,8 @@ class ConfigOptionFloatOrPercent : public ConfigOptionPercent
|
|||
bool deserialize(std::string str) {
|
||||
this->percent = str.find_first_of("%") != std::string::npos;
|
||||
std::istringstream iss(str);
|
||||
return iss >> this->value;
|
||||
iss >> this->value;
|
||||
return !iss.fail();
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue