0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 00:33:02 +03:00

#ScriptEngine: The method setVariable() does not only change the value of the variable but also adds a new one if the variable does not exists

This commit is contained in:
Arin Alex 2017-09-11 21:31:54 +03:00
parent 77cc93e766
commit c9b6078fa8

View File

@ -1491,7 +1491,11 @@ QVariant ScriptFunctionsManager::currencyUSBasedFormat(QVariant value, const QSt
void ScriptFunctionsManager::setVariable(const QString &name, QVariant value)
{
DataSourceManager* dm = scriptEngineManager()->dataManager();
dm->changeVariable(name,value);
if (dm->containsVariable(name)){
dm->changeVariable(name,value);
} else {
dm->addVariable(name, value, VarDesc::User);
}
}
QVariant ScriptFunctionsManager::getVariable(const QString &name)