!WriteKeyValue: Fixed that formulas didn't work.

This commit is contained in:
Birunthan Mohanathas 2012-02-19 13:16:21 +00:00
parent 57025a5434
commit eca9250655

View File

@ -608,13 +608,10 @@ void CRainmeter::Bang_WriteKeyValue(const WCHAR* arg, CMeterWindow* meterWindow)
bool formula = false; bool formula = false;
BOOL write = 0; BOOL write = 0;
if (subStrings.size() > 4) if (meterWindow)
{
CMeterWindow* mw = GetMeterWindow(subStrings[4]);
if (mw)
{ {
double value; double value;
formula = mw->GetParser().ParseFormula(strValue, &value); formula = meterWindow->GetParser().ParseFormula(strValue, &value);
// Formula read fine // Formula read fine
if (formula) if (formula)
@ -626,7 +623,6 @@ void CRainmeter::Bang_WriteKeyValue(const WCHAR* arg, CMeterWindow* meterWindow)
write = WritePrivateProfileString(section, key, buffer, iniWrite); write = WritePrivateProfileString(section, key, buffer, iniWrite);
} }
} }
}
if (!formula) if (!formula)
{ {