Code optimization.

This commit is contained in:
spx
2010-11-25 15:34:49 +00:00
parent d299d89ede
commit 0e1486f0be
13 changed files with 106 additions and 35 deletions

View File

@ -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);