mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-25 13:04:38 +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)
|
void ScriptFunctionsManager::setVariable(const QString &name, QVariant value)
|
||||||
{
|
{
|
||||||
DataSourceManager* dm = scriptEngineManager()->dataManager();
|
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)
|
QVariant ScriptFunctionsManager::getVariable(const QString &name)
|
||||||
|
Loading…
Reference in New Issue
Block a user