summaryrefslogtreecommitdiff
path: root/libtemplate/parameter.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2015-01-19 09:41:49 +0100
committerlouis <louis.braun@gmx.de>2015-01-19 09:41:49 +0100
commit252c15cbc41fa7e962998663b5fb50a88fc6d7dc (patch)
tree23d250433bc971cd26ea321ce83898454f900bad /libtemplate/parameter.c
parentcb9044e5f6613d69db26bd0e81575db9c0ff5a25 (diff)
downloadvdr-plugin-skindesigner-252c15cbc41fa7e962998663b5fb50a88fc6d7dc.tar.gz
vdr-plugin-skindesigner-252c15cbc41fa7e962998663b5fb50a88fc6d7dc.tar.bz2
fixed bug that custom int tokens were not considered in conditions
Diffstat (limited to 'libtemplate/parameter.c')
-rw-r--r--libtemplate/parameter.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/libtemplate/parameter.c b/libtemplate/parameter.c
index b191d17..83597c8 100644
--- a/libtemplate/parameter.c
+++ b/libtemplate/parameter.c
@@ -342,20 +342,24 @@ int cConditionalParameter::EvaluateParameter(string token, map < string, int > *
map < string, int >::iterator hitGlobals = globals->intVars.find(token);
if (hitGlobals != globals->intVars.end()) {
return hitGlobals->second;
- } else {
- //then check tokens
- if (intTokens) {
- map < string, int >::iterator hit = intTokens->find(token);
- if (hit != intTokens->end()) {
- return hit->second;
- }
+ }
+ //then check custom tokens
+ map < string, int >::iterator hitCustomTokens = globals->customIntTokens.find(token);
+ if (hitCustomTokens != globals->customIntTokens.end()) {
+ return hitCustomTokens->second;
+ }
+ //then check tokens
+ if (intTokens) {
+ map < string, int >::iterator hit = intTokens->find(token);
+ if (hit != intTokens->end()) {
+ return hit->second;
}
- if (stringTokens) {
- map < string, string >::iterator hit = stringTokens->find(token);
- if (hit != stringTokens->end()) {
- string value = hit->second;
- return atoi(value.c_str());
- }
+ }
+ if (stringTokens) {
+ map < string, string >::iterator hit = stringTokens->find(token);
+ if (hit != stringTokens->end()) {
+ string value = hit->second;
+ return atoi(value.c_str());
}
}
return 0;