Spreadsheet: fix string save/restore, fixes #6395

This commit is contained in:
0penBrain
2023-05-25 18:53:17 +02:00
committed by Adrián Insaurralde Avalos
parent 734d1adb46
commit 8c6eeb8407

View File

@@ -250,12 +250,7 @@ bool Cell::getStringContent(std::string & s, bool persistent) const
s = "=" + expression->toString(persistent);
else if (freecad_dynamic_cast<App::StringExpression>(expression.get())) {
s = static_cast<App::StringExpression*>(expression.get())->getText();
char * end;
errno = 0;
double d = strtod(s.c_str(), &end);
(void)d; // fix gcc warning
if (!*end && errno == 0)
s = "'" + s;
s = "'" + s;
}
else if (freecad_dynamic_cast<App::ConstantExpression>(expression.get()))
s = "=" + expression->toString();