- Changed std::transform(..., ::towlower/::towupper) to _wcsupr/_wcslwr

- MathParser: Fixed stack overflow (and possible crash) when the nested conditional limit is exceeded
This commit is contained in:
Birunthan Mohanathas
2012-01-25 16:00:49 +00:00
parent 430e287bec
commit 35be827071
6 changed files with 22 additions and 30 deletions

View File

@ -32,19 +32,16 @@ std::unordered_map<std::wstring, Gdiplus::Font*> CMeterString::c_Fonts;
void StringToUpper(std::wstring& str)
{
//change each element of the string to upper case
std::transform(str.begin(), str.end(), str.begin(), ::towupper);
_wcsupr(&str[0]);
}
void StringToLower(std::wstring& str)
{
//change each element of the string to lower case
std::transform(str.begin(), str.end(), str.begin(), ::towlower);
_wcslwr(&str[0]);
}
void StringToProper(std::wstring& str)
{
//change each element of the string to lower case
if (!str.empty())
{
str[0] = towupper(str[0]);