From 5696489a786224631c3ded48f810164ee2c9ff25 Mon Sep 17 00:00:00 2001 From: mrwastl Date: Mon, 3 Oct 2011 01:04:48 +0200 Subject: functions (cSkinFunction) now evaluate parameters with variables and/or tokens too --- glcdskin/function.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'glcdskin/function.c') diff --git a/glcdskin/function.c b/glcdskin/function.c index c6089bc..6d96c57 100644 --- a/glcdskin/function.c +++ b/glcdskin/function.c @@ -360,8 +360,21 @@ cType cSkinFunction::Evaluate(void) const case variable: { cSkinVariable * variable = mSkin->GetVariable(mVariableId); - if (variable) - return variable->Value(); + if (variable) { + cType rv = variable->Value(); + if (rv.IsString()) { + std::string val = rv; + if (val.find("{") != std::string::npos || val.find("#") != std::string::npos) { + cSkinString *result = new cSkinString(mObject, false); + if (result->Parse(val)) { + val = (std::string) result->Evaluate(); + rv = cType(val); + } + delete result; + } + } + return rv; + } return false; } -- cgit v1.2.3