Spreadsheet: preserve component reference in cell

This commit is contained in:
Zheng, Lei
2019-12-26 18:52:46 +08:00
committed by Chris Hennes
parent 51d814d222
commit 93beb9fabd

View File

@@ -247,7 +247,10 @@ const App::Expression *Cell::getExpression(bool withFormat) const
bool Cell::getStringContent(std::string & s, bool persistent) const
{
if (expression) {
if (freecad_dynamic_cast<App::StringExpression>(expression.get())) {
s.clear();
if(expression->hasComponent())
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;