fix(label): Remove surrounding quotes

Fixes #221
This commit is contained in:
Michael Carlberg 2016-12-04 17:28:57 +01:00
parent 9eee27544d
commit d93bd635b4
2 changed files with 7 additions and 7 deletions

View File

@ -55,13 +55,7 @@ string builder::flush() {
* Insert raw text string
*/
void builder::append(string text) {
string str(move(text));
size_t len{str.length()};
if (len > 2 && str[0] == '"' && str[len - 1] == '"') {
m_output += str.substr(1, len - 2);
} else {
m_output += str;
}
m_output += text;
}
/**

View File

@ -135,6 +135,12 @@ namespace drawtypes {
text = conf.get<string>(section, name, move(def));
}
size_t len{text.size()};
if (len > 2 && text[0] == '"' && text[len - 1] == '"') {
text = text.substr(1, len - 2);
}
const auto get_left_right = [&](string key) {
auto value = conf.get<int>(section, key, 0);
auto left = conf.get<int>(section, key + "-left", value);