[PATCH v4] comctl32: Implement handling of EM_SETCUEBANNER/EM_GETCUEBANNER messages.
Nikolay Sivov
nsivov at codeweavers.com
Wed Oct 24 11:36:40 CDT 2018
On 10/24/2018 07:02 PM, Sergio Gómez Del Real wrote:
> +static inline WCHAR *heap_strdupW(const WCHAR *str)
> +{
> + int len = strlenW(str) + 1;
> + WCHAR *ret = heap_alloc(len * sizeof(WCHAR));
> + lstrcpynW(ret, str, len);
> + return ret;
> +}
Now there will be two different functions under the same name (and you
don't need lstrcpynW if you know the length).
> + if (!es->cue_banner_text)
> + {
> + if (!(es->style & ES_MULTILINE) && buf && size)
> + *buf = 0;
> + return FALSE;
> + }
I don't think tests cover that.
> + if (buf && size)
> + {
> + if (size > strlenW(es->cue_banner_text))
> + size = strlenW(es->cue_banner_text) + 1;
> + lstrcpynW(buf, es->cue_banner_text, size);
> + }
Why this size fixup is necessary?
> +static void test_cue_banner(void)
> +{
> + HWND hwnd_edit;
> + BOOL ret;
> + static WCHAR testW[] = {'T','e','s','t',0};
> + static WCHAR testcmp1W[] = {'T','e','s','t',0};
> + static WCHAR testcmp2W[] = {'T','e','s',0};
> + static WCHAR getcuetestW[5] = {'T',0};
> + static WCHAR emptyW[] = {0};
One constant for text and one buffer to get it back is enough.
> + ret = SendMessageW(hwnd_edit, EM_GETCUEBANNER, 0, 5);
> + ok(ret == TRUE, "EM_GETCUEBANNER should have returned FALSE.\n");
Typo.
More information about the wine-devel
mailing list