equal
deleted
inserted
replaced
1088 HGLOBAL cbuf; |
1088 HGLOBAL cbuf; |
1089 char utf8_buf[512]; |
1089 char utf8_buf[512]; |
1090 const char *ptr; |
1090 const char *ptr; |
1091 |
1091 |
1092 WChar c; |
1092 WChar c; |
1093 size_t width, length; |
1093 uint16 width, length; |
1094 |
1094 |
1095 if (IsClipboardFormatAvailable(CF_UNICODETEXT)) { |
1095 if (IsClipboardFormatAvailable(CF_UNICODETEXT)) { |
1096 OpenClipboard(NULL); |
1096 OpenClipboard(NULL); |
1097 cbuf = GetClipboardData(CF_UNICODETEXT); |
1097 cbuf = GetClipboardData(CF_UNICODETEXT); |
1098 |
1098 |
1120 width = length = 0; |
1120 width = length = 0; |
1121 |
1121 |
1122 for (ptr = utf8_buf; (c = Utf8Consume(&ptr)) != '\0';) { |
1122 for (ptr = utf8_buf; (c = Utf8Consume(&ptr)) != '\0';) { |
1123 if (!IsPrintable(c)) break; |
1123 if (!IsPrintable(c)) break; |
1124 |
1124 |
1125 size_t len = Utf8CharLen(c); |
1125 byte len = Utf8CharLen(c); |
1126 if (tb->length + length >= tb->maxlength - len) break; |
1126 if (tb->length + length >= tb->maxlength - len) break; |
1127 |
1127 |
1128 byte charwidth = GetCharacterWidth(FS_NORMAL, c); |
1128 byte charwidth = GetCharacterWidth(FS_NORMAL, c); |
1129 if (tb->maxwidth != 0 && width + tb->width + charwidth > tb->maxwidth) break; |
1129 if (tb->maxwidth != 0 && width + tb->width + charwidth > tb->maxwidth) break; |
1130 |
1130 |