From 9f56ff279316b1d82d5639e47d587a37dbd6b0c8 Mon Sep 17 00:00:00 2001 From: mrwastl Date: Thu, 12 May 2011 00:54:19 +0200 Subject: variable values that represent functions are now evaluated at run time --- glcdskin/variable.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'glcdskin/variable.c') diff --git a/glcdskin/variable.c b/glcdskin/variable.c index b07773a..3bd6e29 100644 --- a/glcdskin/variable.c +++ b/glcdskin/variable.c @@ -11,6 +11,7 @@ cSkinVariable::cSkinVariable(cSkin * Parent) : mSkin(Parent), mValue(0), mCondition(NULL), + mFunction(NULL), mDummyDisplay(mSkin), mDummyObject(&mDummyDisplay) { @@ -20,14 +21,16 @@ bool cSkinVariable::ParseValue(const std::string & Text) { if (isalpha(Text[0]) || Text[0] == '#') { - cSkinFunction * func = new cSkinFunction(&mDummyObject); - if (func->Parse(Text)) + delete mFunction; + mFunction = new cSkinFunction(&mDummyObject); + if (mFunction->Parse(Text)) { - mValue = func->Evaluate(); - delete func; + //mValue = func->Evaluate(); + //delete func; return true; } - delete func; + delete mFunction; + mFunction = NULL; } else if (Text[0] == '\'') { -- cgit v1.2.3