Huw Davies : comdlg32: Add a helper to return the dialog struct.
Alexandre Julliard
julliard at winehq.org
Fri Jan 23 10:06:58 CST 2009
Module: wine
Branch: master
Commit: 2409e33f0826fc5c187f68ed10ce292a1e894b02
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2409e33f0826fc5c187f68ed10ce292a1e894b02
Author: Huw Davies <huw at codeweavers.com>
Date: Fri Jan 23 11:12:17 2009 +0000
comdlg32: Add a helper to return the dialog struct.
---
dlls/comdlg32/printdlg.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c
index 1d1d2da..12c0b6a 100644
--- a/dlls/comdlg32/printdlg.c
+++ b/dlls/comdlg32/printdlg.c
@@ -2807,6 +2807,14 @@ static inline LPPAGESETUPHOOK pagesetup_get_hook(const pagesetup_data *data, hoo
return NULL;
}
+/* This should only be used in calls to hook procs so we return the ptr
+ already cast to LPARAM */
+static inline LPARAM pagesetup_get_dlg_struct(const pagesetup_data *data)
+{
+ return (LPARAM)data->dlga;
+}
+
+
static inline void swap_point(POINT *pt)
{
LONG tmp = pt->x;
@@ -3571,7 +3579,8 @@ PRINTDLG_PagePaintProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
WARN("__WINE_PAGESETUPDLGDATA prop not set?\n");
return FALSE;
}
- if (default_page_paint_hook(hWnd, WM_PSD_PAGESETUPDLG, MAKELONG(papersize, orientation), (LPARAM)data->dlga, data))
+ if (default_page_paint_hook(hWnd, WM_PSD_PAGESETUPDLG, MAKELONG(papersize, orientation),
+ pagesetup_get_dlg_struct(data), data))
return FALSE;
hdc = BeginPaint(hWnd, &ps);
@@ -3703,7 +3712,8 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
res = TRUE;
if (pagesetup_get_flags(data) & PSD_ENABLEPAGESETUPHOOK)
{
- if (!pagesetup_get_hook(data, page_setup_hook)(hDlg, uMsg, wParam, (LPARAM)data->dlga))
+ if (!pagesetup_get_hook(data, page_setup_hook)(hDlg, uMsg, wParam,
+ pagesetup_get_dlg_struct(data)))
FIXME("Setup page hook failed?\n");
}
More information about the wine-cvs
mailing list