0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.0052

This commit is contained in:
Bram Moolenaar
2005-02-26 23:04:13 +00:00
parent 5313dcb75a
commit 05159a0c6a
57 changed files with 9098 additions and 348 deletions

View File

@@ -1346,22 +1346,16 @@ clip_mch_request_selection(VimClipboard *cbd)
break;
}
#if defined(FEAT_MBYTE) && defined(WIN3264)
# if defined(FEAT_MBYTE) && defined(WIN3264)
/* The text is in the active codepage. Convert to 'encoding',
* going through UCS-2. */
MultiByteToWideChar_alloc(GetACP(), 0, str, str_size,
(LPWSTR *)&to_free, &maxlen);
acp_to_enc(str, str_size, &to_free, &maxlen);
if (to_free != NULL)
{
str_size = maxlen;
str = ucs2_to_enc((short_u *)to_free, &str_size);
if (str != NULL)
{
vim_free(to_free);
to_free = str;
}
str = to_free;
}
#endif
# endif
}
}
#ifdef FEAT_MBYTE
@@ -1398,6 +1392,31 @@ clip_mch_request_selection(VimClipboard *cbd)
#endif
}
#if (defined(FEAT_MBYTE) && defined(WIN3264)) || defined(PROTO)
/*
* Convert from the active codepage to 'encoding'.
* Input is "str[str_size]".
* The result is in allocated memory: "out[outlen]". With terminating NUL.
*/
void
acp_to_enc(str, str_size, out, outlen)
char_u *str;
int str_size;
char_u **out;
int *outlen;
{
LPWSTR widestr;
MultiByteToWideChar_alloc(GetACP(), 0, str, str_size, &widestr, outlen);
if (widestr != NULL)
{
*out = ucs2_to_enc((short_u *)widestr, outlen);
vim_free(widestr);
}
}
#endif
/*
* Send the current selection to the clipboard.
*/