diff --git a/Library/ConfigParser.cpp b/Library/ConfigParser.cpp index 942cc3ae..5739ed91 100644 --- a/Library/ConfigParser.cpp +++ b/Library/ConfigParser.cpp @@ -759,7 +759,14 @@ double CConfigParser::ReadFormula(LPCTSTR section, LPCTSTR key, double defValue) char* errMsg = MathParser_Parse(m_Parser, ConvertToAscii(result.substr(1, result.size() - 2).c_str()).c_str(), &resultValue); if (errMsg != NULL) { - Log(LOG_ERROR, ConvertToWide(errMsg).c_str()); + std::wstring error = L"ReadFormula: "; + error += ConvertToWide(errMsg); + error += L" in key \""; + error += key ? key : L""; + error += L"\" in section ["; + error += section ? section : L""; + error += L"]."; + Log(LOG_ERROR, error.c_str()); } return resultValue; @@ -778,7 +785,11 @@ bool CConfigParser::ReadFormula(const std::wstring& result, double* resultValue) char* errMsg = MathParser_Parse(m_Parser, ConvertToAscii(result.substr(1, result.size() - 2).c_str()).c_str(), resultValue); if (errMsg != NULL) { - Log(LOG_ERROR, ConvertToWide(errMsg).c_str()); + std::wstring error = L"ReadFormula: "; + error += ConvertToWide(errMsg); + error += L": "; + error += result; + Log(LOG_ERROR, error.c_str()); return false; } diff --git a/Library/MeasureCalc.cpp b/Library/MeasureCalc.cpp index 0b14d988..ce431c02 100644 --- a/Library/MeasureCalc.cpp +++ b/Library/MeasureCalc.cpp @@ -82,7 +82,12 @@ bool CMeasureCalc::Update() char* errMsg = MathParser_Parse(m_Parser, ConvertToAscii(m_Formula.c_str()).c_str(), &m_Value); if (errMsg != NULL) { - Log(LOG_ERROR, ConvertToWide(errMsg).c_str()); + std::wstring error = L"Calc: "; + error += ConvertToWide(errMsg); + error += L" in measure ["; + error += m_Name; + error += L"]."; + Log(LOG_ERROR, error.c_str()); } return PostUpdate(); diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index f1d7f191..a8bfe0a6 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -3781,7 +3781,7 @@ void CRainmeter::ShowContextMenu(POINT pos, CMeterWindow* meterWindow) { if (!m_ConfigMenu.empty()) { - DeleteMenu(configMenu, 0, MF_BYPOSITION); + DeleteMenu(configMenu, 0, MF_BYPOSITION); // "No skins available" menuitem CreateConfigMenu(configMenu, m_ConfigMenu); } @@ -3796,7 +3796,7 @@ void CRainmeter::ShowContextMenu(POINT pos, CMeterWindow* meterWindow) { if (!m_Themes.empty()) { - DeleteMenu(themeMenu, 0, MF_BYPOSITION); + DeleteMenu(themeMenu, 0, MF_BYPOSITION); // "No themes available" menuitem CreateThemeMenu(themeMenu); } } @@ -3926,12 +3926,9 @@ HMENU CRainmeter::CreateConfigMenu(HMENU configMenu, std::vector& co void CRainmeter::CreateThemeMenu(HMENU themeMenu) { - if (!m_Themes.empty()) + for (size_t i = 0, isize = m_Themes.size(); i < isize; ++i) { - for (size_t i = 0, isize = m_Themes.size(); i < isize; ++i) - { - InsertMenu(themeMenu, i, MF_BYPOSITION, ID_THEME_FIRST + i, m_Themes[i].c_str()); - } + InsertMenu(themeMenu, i, MF_BYPOSITION, ID_THEME_FIRST + i, m_Themes[i].c_str()); } }