mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Code optimization.
This commit is contained in:
@ -230,7 +230,9 @@ void CMeterString::Initialize()
|
||||
|
||||
if (m_FontSize != 0)
|
||||
{
|
||||
throw CError(std::wstring(L"Unable to create font: ") + m_FontFace, __LINE__, __FILE__);
|
||||
std::wstring error = L"Unable to create font: ";
|
||||
error += m_FontFace;
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -331,7 +333,12 @@ void CMeterString::ReadConfig(const WCHAR* section)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw CError(std::wstring(L"StringAlign=") + align + L" is not valid in meter [" + m_Name + L"].", __LINE__, __FILE__);
|
||||
std::wstring error = L"StringAlign=";
|
||||
error += align;
|
||||
error += L" is not valid in meter [";
|
||||
error += m_Name;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
}
|
||||
|
||||
std::wstring stringCase = parser.ReadString(section, L"StringCase", L"NONE");
|
||||
@ -354,7 +361,12 @@ void CMeterString::ReadConfig(const WCHAR* section)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw CError(std::wstring(L"StringCase=") + stringCase + L" is not valid in meter [" + m_Name + L"].", __LINE__, __FILE__);
|
||||
std::wstring error = L"StringCase=";
|
||||
error += stringCase;
|
||||
error += L" is not valid in meter [";
|
||||
error += m_Name;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
}
|
||||
|
||||
std::wstring style = parser.ReadString(section, L"StringStyle", L"NORMAL");
|
||||
@ -377,7 +389,12 @@ void CMeterString::ReadConfig(const WCHAR* section)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw CError(std::wstring(L"StringStyle=") + style + L" is not valid in meter [" + m_Name + L"].", __LINE__, __FILE__);
|
||||
std::wstring error = L"StringStyle=";
|
||||
error += style;
|
||||
error += L" is not valid in meter [";
|
||||
error += m_Name;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
}
|
||||
|
||||
std::wstring effect = parser.ReadString(section, L"StringEffect", L"NONE");
|
||||
@ -396,7 +413,12 @@ void CMeterString::ReadConfig(const WCHAR* section)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw CError(std::wstring(L"StringEffect=") + effect + L" is not valid in meter [" + m_Name + L"].", __LINE__, __FILE__);
|
||||
std::wstring error = L"StringEffect=";
|
||||
error += effect;
|
||||
error += L" is not valid in meter [";
|
||||
error += m_Name;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
}
|
||||
|
||||
if (-1 != (int)parser.ReadFormula(section, L"W", -1) && -1 != (int)parser.ReadFormula(section, L"H", -1))
|
||||
@ -634,7 +656,12 @@ void CMeterString::BindMeasure(const std::list<CMeasure*>& measures)
|
||||
|
||||
if (i == measures.end())
|
||||
{
|
||||
throw CError(std::wstring(L"The meter [") + m_Name + L"] cannot be bound with [" + (*j) + L"]!", __LINE__, __FILE__);
|
||||
std::wstring error = L"The meter [";
|
||||
error += m_Name;
|
||||
error += L"] cannot be bound with [";
|
||||
error += (*j);
|
||||
error += L"]!";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
}
|
||||
}
|
||||
CMeter::SetAllMeasures(m_Measures);
|
||||
|
Reference in New Issue
Block a user