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:
parent
77cc93e766
commit
c9b6078fa8
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user