Added line break & removed function call in compare operator.

This commit is contained in:
cpascal 2015-03-03 13:40:40 +09:00
parent 8d9da362e5
commit 4058e16f16
1 changed files with 11 additions and 8 deletions

View File

@ -436,7 +436,9 @@ LRESULT CALLBACK CWin32InputBox::DlgProc(HWND hDlg, UINT message, WPARAM wParam,
_this->_param->pstrResult->clear(); _this->_param->pstrResult->clear();
if (conversionResult) if (conversionResult)
{ {
if((_this->_param->nMaxLength > 0) && (_this->_param->nMaxLength < (DWORD) cocos2d::StringUtils::getCharacterCountInUTF8String(utf8Result))) DWORD inputLengthAsUTF8 = (DWORD) cocos2d::StringUtils::getCharacterCountInUTF8String(utf8Result);
if ((_this->_param->nMaxLength > 0) &&
(_this->_param->nMaxLength < inputLengthAsUTF8))
{ {
// LengthFilter // LengthFilter
for (size_t pos=0; pos < _this->_param->nMaxLength; pos++) for (size_t pos=0; pos < _this->_param->nMaxLength; pos++)
@ -444,7 +446,8 @@ LRESULT CALLBACK CWin32InputBox::DlgProc(HWND hDlg, UINT message, WPARAM wParam,
std::string utf8Bytes; std::string utf8Bytes;
std::u16string utf16Character(1, wstrResult[pos]); std::u16string utf16Character(1, wstrResult[pos]);
if(cocos2d::StringUtils::UTF16ToUTF8(utf16Character, utf8Bytes)) bool utf16toutf8ConversionResult = cocos2d::StringUtils::UTF16ToUTF8(utf16Character, utf8Bytes);
if (utf16toutf8ConversionResult)
{ {
_this->_param->pstrResult->append(utf8Bytes); _this->_param->pstrResult->append(utf8Bytes);
} }