Changeset 238175 in webkit
- Timestamp:
- Nov 14, 2018 8:13:06 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r238173 r238175 1 2018-11-14 Christopher Reid <chris.reid@sony.com> 2 3 [WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp 4 https://bugs.webkit.org/show_bug.cgi?id=191606 5 6 Reviewed by Michael Catanzaro. 7 8 No behavior change. 9 10 Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString. 11 12 * platform/wpe/PlatformKeyboardEventWPE.cpp: 13 (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode): 14 (WebCore::PlatformKeyboardEvent::singleCharacterString): 15 1 16 2018-11-13 Zalan Bujtas <zalan@apple.com> 2 17 -
trunk/Source/WebCore/platform/wpe/PlatformKeyboardEventWPE.cpp
r234645 r238175 29 29 #include "WindowsKeyboardCodes.h" 30 30 #include <wpe/wpe.h> 31 #include <wtf/ glib/GUniquePtr.h>31 #include <wtf/text/StringBuilder.h> 32 32 33 33 namespace WebCore { … … 427 427 } 428 428 429 guint32 unicodeCharacter = wpe_key_code_to_unicode(keyCode); 430 if (unicodeCharacter) { 431 // UTF-8 will use up to 6 bytes. 432 char utf8[7] = { 0 }; 433 g_unichar_to_utf8(unicodeCharacter, utf8); 434 return String::fromUTF8(utf8); 429 UChar32 unicodeCharacter = wpe_key_code_to_unicode(keyCode); 430 if (unicodeCharacter && U_IS_UNICODE_CHAR(unicodeCharacter)) { 431 StringBuilder builder; 432 builder.append(unicodeCharacter); 433 return builder.toString(); 435 434 } 436 435 … … 1305 1304 } 1306 1305 1307 gunichar c = wpe_key_code_to_unicode(val); 1308 glong length; 1309 GUniquePtr<gunichar2> uchar16(g_ucs4_to_utf16(&c, 1, nullptr, &length, nullptr)); 1310 if (uchar16) 1311 return String(reinterpret_cast<UChar*>(uchar16.get()), length); 1306 UChar32 unicodeCharacter = wpe_key_code_to_unicode(val); 1307 if (unicodeCharacter && U_IS_UNICODE_CHAR(unicodeCharacter)) { 1308 StringBuilder builder; 1309 builder.append(unicodeCharacter); 1310 return builder.toString(); 1311 } 1312 1312 1313 1313 return { };
Note: See TracChangeset
for help on using the changeset viewer.