mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
!WriteKeyValue: Fixed that formulas didn't work.
This commit is contained in:
parent
57025a5434
commit
eca9250655
@ -608,23 +608,19 @@ 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]);
|
double value;
|
||||||
if (mw)
|
formula = meterWindow->GetParser().ParseFormula(strValue, &value);
|
||||||
|
|
||||||
|
// Formula read fine
|
||||||
|
if (formula)
|
||||||
{
|
{
|
||||||
double value;
|
WCHAR buffer[256];
|
||||||
formula = mw->GetParser().ParseFormula(strValue, &value);
|
int len = _snwprintf_s(buffer, _TRUNCATE, L"%.5f", value);
|
||||||
|
CMeasure::RemoveTrailingZero(buffer, len);
|
||||||
|
|
||||||
// Formula read fine
|
write = WritePrivateProfileString(section, key, buffer, iniWrite);
|
||||||
if (formula)
|
|
||||||
{
|
|
||||||
WCHAR buffer[256];
|
|
||||||
int len = _snwprintf_s(buffer, _TRUNCATE, L"%.5f", value);
|
|
||||||
CMeasure::RemoveTrailingZero(buffer, len);
|
|
||||||
|
|
||||||
write = WritePrivateProfileString(section, key, buffer, iniWrite);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user