comctl32/taskdialog: Fix buttons might disappear.
In the old button layout algorithm, line count is added before adding button. This cause line count buffer overflow when the first button is very long. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
10e4eb8aca
commit
5d7fa27a2f
|
@ -506,16 +506,15 @@ static void taskdialog_layout(struct taskdialog_info *dialog_info)
|
|||
x = h_spacing;
|
||||
for (i = 0, line_count = 0; i < dialog_info->button_count; i++)
|
||||
{
|
||||
if (x + button_layout_infos[i].width + h_spacing >= dialog_width)
|
||||
button_layout_infos[i].line = line_count;
|
||||
x += button_layout_infos[i].width + h_spacing;
|
||||
line_widths[line_count] += button_layout_infos[i].width + h_spacing;
|
||||
|
||||
if ((i + 1 < dialog_info->button_count) && (x + button_layout_infos[i + 1].width + h_spacing >= dialog_width))
|
||||
{
|
||||
x = h_spacing;
|
||||
line_count++;
|
||||
}
|
||||
|
||||
button_layout_infos[i].line = line_count;
|
||||
|
||||
x += button_layout_infos[i].width + h_spacing;
|
||||
line_widths[line_count] += button_layout_infos[i].width + h_spacing;
|
||||
}
|
||||
line_count++;
|
||||
|
||||
|
|
Loading…
Reference in New Issue