mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-24 12:34:39 +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();
|
||||
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