[PATCH 8/8] comctl32/taskdialog: Delete unused template related code.
Zhiyi Zhang
zzhang at codeweavers.com
Mon Jun 11 23:11:17 CDT 2018
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
dlls/comctl32/taskdialog.c | 101 +------------------------------------
1 file changed, 1 insertion(+), 100 deletions(-)
diff --git a/dlls/comctl32/taskdialog.c b/dlls/comctl32/taskdialog.c
index fef269fc0b..7a09b8a6d2 100644
--- a/dlls/comctl32/taskdialog.c
+++ b/dlls/comctl32/taskdialog.c
@@ -34,16 +34,10 @@
#include "comctl32.h"
#include "wine/debug.h"
-#include "wine/list.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(taskdialog);
-#define ALIGNED_LENGTH(_Len, _Align) (((_Len)+(_Align))&~(_Align))
-#define ALIGNED_POINTER(_Ptr, _Align) ((LPVOID)ALIGNED_LENGTH((ULONG_PTR)(_Ptr), _Align))
-#define ALIGN_LENGTH(_Len, _Align) _Len = ALIGNED_LENGTH(_Len, _Align)
-#define ALIGN_POINTER(_Ptr, _Align) _Ptr = ALIGNED_POINTER(_Ptr, _Align)
-
static const UINT DIALOG_MIN_WIDTH = 240;
static const UINT DIALOG_SPACING = 5;
static const UINT DIALOG_BUTTON_WIDTH = 50;
@@ -52,21 +46,6 @@ static const UINT DIALOG_TIMER_MS = 200;
static const UINT ID_TIMER = 1;
-struct taskdialog_control
-{
- struct list entry;
- DLGITEMTEMPLATE *template;
- unsigned int template_size;
-};
-
-struct taskdialog_template_desc
-{
- const TASKDIALOGCONFIG *taskconfig;
- struct list controls;
- WORD control_count;
- struct taskdialog_button_desc *default_button;
-};
-
struct taskdialog_info
{
HWND hwnd;
@@ -108,59 +87,6 @@ static void template_write_data(char **ptr, const void *src, unsigned int size)
*ptr += size;
}
-static unsigned int taskdialog_add_control(struct taskdialog_template_desc *desc, WORD id, const WCHAR *class,
- HINSTANCE hInstance, const WCHAR *text, DWORD style)
-{
- struct taskdialog_control *control = Alloc(sizeof(*control));
- unsigned int size, class_size, text_size;
- DLGITEMTEMPLATE *template;
- static const WCHAR nulW;
- const WCHAR *textW;
- char *ptr;
-
- class_size = (strlenW(class) + 1) * sizeof(WCHAR);
-
- if (IS_INTRESOURCE(text))
- text_size = LoadStringW(hInstance, (UINT_PTR)text, (WCHAR *)&textW, 0) * sizeof(WCHAR);
- else
- {
- textW = text;
- text_size = strlenW(textW) * sizeof(WCHAR);
- }
-
- size = sizeof(DLGITEMTEMPLATE);
- size += class_size;
- size += text_size + sizeof(WCHAR);
- size += sizeof(WORD); /* creation data */
-
- control->template = template = Alloc(size);
- control->template_size = size;
-
- template->style = WS_VISIBLE | style;
- template->dwExtendedStyle = 0;
- template->id = id;
- ptr = (char *)(template + 1);
- template_write_data(&ptr, class, class_size);
- template_write_data(&ptr, textW, text_size);
- template_write_data(&ptr, &nulW, sizeof(nulW));
-
- list_add_tail(&desc->controls, &control->entry);
- desc->control_count++;
- return ALIGNED_LENGTH(size, 3);
-}
-
-static void taskdialog_clear_controls(struct list *controls)
-{
- struct taskdialog_control *control, *control2;
-
- LIST_FOR_EACH_ENTRY_SAFE(control, control2, controls, struct taskdialog_control, entry)
- {
- list_remove(&control->entry);
- Free(control->template);
- Free(control);
- }
-}
-
static unsigned int taskdialog_get_reference_rect(const TASKDIALOGCONFIG *taskconfig, RECT *ret)
{
HMONITOR monitor = MonitorFromWindow(taskconfig->hwndParent ? taskconfig->hwndParent : GetActiveWindow(),
@@ -194,9 +120,7 @@ static WCHAR *taskdialog_get_exe_name(WCHAR *name, DWORD length)
static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfig)
{
- struct taskdialog_control *control, *control2;
unsigned int size, title_size;
- struct taskdialog_template_desc desc;
static const WORD fontsize = 0x7fff;
static const WCHAR emptyW[] = { 0 };
const WCHAR *titleW = NULL;
@@ -222,23 +146,13 @@ static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfi
size += title_size;
size += 2; /* font size */
- list_init(&desc.controls);
- desc.taskconfig = taskconfig;
- desc.control_count = 0;
- desc.default_button = NULL;
-
template = Alloc(size);
- if (!template)
- {
- taskdialog_clear_controls(&desc.controls);
- return NULL;
- }
+ if (!template) return NULL;
template->style = DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_VISIBLE | WS_SYSMENU;
if (taskconfig->dwFlags & TDF_CAN_BE_MINIMIZED) template->style |= WS_MINIMIZEBOX;
if (!(taskconfig->dwFlags & TDF_NO_SET_FOREGROUND)) template->style |= DS_SETFOREGROUND;
if (taskconfig->dwFlags & TDF_RTL_LAYOUT) template->dwExtendedStyle = WS_EX_LAYOUTRTL | WS_EX_RIGHT | WS_EX_RTLREADING;
- template->cdit = desc.control_count;
ptr = (char *)(template + 1);
ptr += 2; /* menu */
@@ -246,19 +160,6 @@ static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfi
template_write_data(&ptr, titleW, title_size);
template_write_data(&ptr, &fontsize, sizeof(fontsize));
- /* write control entries */
- LIST_FOR_EACH_ENTRY_SAFE(control, control2, &desc.controls, struct taskdialog_control, entry)
- {
- ALIGN_POINTER(ptr, 3);
-
- template_write_data(&ptr, control->template, control->template_size);
-
- /* list item won't be needed later */
- list_remove(&control->entry);
- Free(control->template);
- Free(control);
- }
-
return template;
}
--
2.17.1
More information about the wine-devel
mailing list