|
From: Ralph T. <ra...@us...> - 2005-04-01 20:52:31
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/visual/sources/win In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14308/adobe-source/adobe/test/visual/sources/win Modified Files: ui_core_implementation.cpp Log Message: Using real UTF-16 <-> UTF-8 conversion now. Popup menus work again. Index: ui_core_implementation.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/visual/sources/win/ui_core_implementation.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ui_core_implementation.cpp 1 Apr 2005 19:11:49 -0000 1.6 --- ui_core_implementation.cpp 1 Apr 2005 20:52:20 -0000 1.7 *************** *** 102,115 **** std::string convert_utf(const WCHAR* buffer, std::size_t size) { ! std::string result; ! ! // REVISIT (fbrereto) : use real utf16->utf8, please! ! for(std::size_t i(0); i < size; ++i) ! { ! std::string::value_type new_char(buffer[i]); ! result.append(std::string(&new_char, 1)); ! } ! ! return result; } --- 102,113 ---- std::string convert_utf(const WCHAR* buffer, std::size_t size) { ! typedef std::vector<char> buftype; ! int length = WideCharToMultiByte(CP_UTF8, 0, buffer, size, 0, 0, 0, 0); ! buftype tmpbuf(length + 1); ! // ! // Convert characters. ! // ! WideCharToMultiByte(CP_UTF8, 0, buffer, size, &(tmpbuf[0]), length, 0, 0); ! return std::string(&(tmpbuf[0])); } *************** *** 129,142 **** std::wstring convert_utf(const CHAR* buffer, std::size_t size) { ! std::wstring result; ! ! // REVISIT (fbrereto) : use real utf16->utf8, please! ! for(std::size_t i(0); i < size; ++i) ! { ! std::wstring::value_type new_char(buffer[i]); ! result.append(std::wstring(&new_char, 1)); ! } ! ! return result; } --- 127,138 ---- std::wstring convert_utf(const CHAR* buffer, std::size_t size) { ! typedef std::vector<WCHAR> buftype; ! int length = MultiByteToWideChar(CP_UTF8, 0, buffer, size, 0, 0); ! buftype tmpbuf(length + 1); ! // ! // Convert characters. ! // ! MultiByteToWideChar(CP_UTF8, 0, buffer, size, &(tmpbuf[0]), length); ! return std::wstring(&(tmpbuf[0])); } *************** *** 3404,3408 **** --- 3400,3407 ---- geometry_m.width() -= width; } + long old_height = geometry_m.height(); + geometry_m.height() += (menu_items_m.size() + 1) * geometry_m.height(); _super::set_bounds(position, geometry_m); + geometry_m.height() = old_height; } |