olepropframe.c (c2c66aff) olepropframe.c (d506c2af)
1/*
2 * Copyright 1999 Corel Corporation
3 * Sean Langley
4 * Copyright 2010 Geoffrey Hausheer
5 * Copyright 2010 Piotr Caban for CodeWeavers
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public

--- 5 unchanged lines hidden (view full) ---

14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
1/*
2 * Copyright 1999 Corel Corporation
3 * Sean Langley
4 * Copyright 2010 Geoffrey Hausheer
5 * Copyright 2010 Piotr Caban for CodeWeavers
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public

--- 5 unchanged lines hidden (view full) ---

14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include "precomp.h"
22#include <stdarg.h>
23
23
24#include <oledlg.h>
24#define COBJMACROS
25#define NONAMELESSUNION
25
26
27#include "windef.h"
28#include "winbase.h"
29#include "wingdi.h"
30#include "ole2.h"
31#include "olectl.h"
32#include "oledlg.h"
33#include "wine/debug.h"
34
26WINE_DEFAULT_DEBUG_CHANNEL(ole);
27
28typedef struct {
29 IPropertyPageSite IPropertyPageSite_iface;
30 LCID lcid;
31 LONG ref;
32} PropertyPageSite;
33

--- 138 unchanged lines hidden (view full) ---

172 return E_POINTER;
173
174 TRACE("(%d %p %d %d %s %d %p %d %p %d %d)\n", lpParams->cbStructSize,
175 lpParams->hWndOwner, lpParams->x, lpParams->y,
176 debugstr_w(lpParams->lpszCaption), lpParams->cObjects,
177 lpParams->lplpUnk, lpParams->cPages, lpParams->lpPages,
178 lpParams->lcid, lpParams->dispidInitialProperty);
179
35WINE_DEFAULT_DEBUG_CHANNEL(ole);
36
37typedef struct {
38 IPropertyPageSite IPropertyPageSite_iface;
39 LCID lcid;
40 LONG ref;
41} PropertyPageSite;
42

--- 138 unchanged lines hidden (view full) ---

181 return E_POINTER;
182
183 TRACE("(%d %p %d %d %s %d %p %d %p %d %d)\n", lpParams->cbStructSize,
184 lpParams->hWndOwner, lpParams->x, lpParams->y,
185 debugstr_w(lpParams->lpszCaption), lpParams->cObjects,
186 lpParams->lplpUnk, lpParams->cPages, lpParams->lpPages,
187 lpParams->lcid, lpParams->dispidInitialProperty);
188
180 if(!lpParams->lplpUnk || !lpParams->lpPages)
189 if(!lpParams->lpPages)
181 return E_POINTER;
182
183 if(lpParams->cbStructSize != sizeof(OCPFIPARAMS)) {
184 WARN("incorrect structure size\n");
185 return E_INVALIDARG;
186 }
187
188 if(lpParams->dispidInitialProperty)

--- 85 unchanged lines hidden (view full) ---

274 &property_page_site->IPropertyPageSite_iface);
275 IPropertyPageSite_Release(&property_page_site->IPropertyPageSite_iface);
276 if(FAILED(res))
277 continue;
278
279 res = IPropertyPage_SetObjects(property_page[i],
280 lpParams->cObjects, lpParams->lplpUnk);
281 if(FAILED(res))
190 return E_POINTER;
191
192 if(lpParams->cbStructSize != sizeof(OCPFIPARAMS)) {
193 WARN("incorrect structure size\n");
194 return E_INVALIDARG;
195 }
196
197 if(lpParams->dispidInitialProperty)

--- 85 unchanged lines hidden (view full) ---

283 &property_page_site->IPropertyPageSite_iface);
284 IPropertyPageSite_Release(&property_page_site->IPropertyPageSite_iface);
285 if(FAILED(res))
286 continue;
287
288 res = IPropertyPage_SetObjects(property_page[i],
289 lpParams->cObjects, lpParams->lplpUnk);
290 if(FAILED(res))
282 continue;
291 WARN("SetObjects() failed, hr %#x.\n", res);
283
284 res = IPropertyPage_GetPageInfo(property_page[i], &page_info);
285 if(FAILED(res))
286 continue;
287
288 dialogs[i].template.cx = MulDiv(page_info.size.cx, 4, font_width);
289 dialogs[i].template.cy = MulDiv(page_info.size.cy, 8, font_height);
290
291 property_sheet_page.u.pResource = &dialogs[i].template;
292 property_sheet_page.lParam = (LPARAM)property_page[i];
293 property_sheet_page.pszTitle = page_info.pszTitle;
294
295 property_sheet.u3.phpage[property_sheet.nPages++] =
296 CreatePropertySheetPageW(&property_sheet_page);
297 }
298
299 PropertySheetW(&property_sheet);
300
301 for(i=0; i<lpParams->cPages; i++) {
292
293 res = IPropertyPage_GetPageInfo(property_page[i], &page_info);
294 if(FAILED(res))
295 continue;
296
297 dialogs[i].template.cx = MulDiv(page_info.size.cx, 4, font_width);
298 dialogs[i].template.cy = MulDiv(page_info.size.cy, 8, font_height);
299
300 property_sheet_page.u.pResource = &dialogs[i].template;
301 property_sheet_page.lParam = (LPARAM)property_page[i];
302 property_sheet_page.pszTitle = page_info.pszTitle;
303
304 property_sheet.u3.phpage[property_sheet.nPages++] =
305 CreatePropertySheetPageW(&property_sheet_page);
306 }
307
308 PropertySheetW(&property_sheet);
309
310 for(i=0; i<lpParams->cPages; i++) {
302 if(property_page[i]) {
303 IPropertyPage_SetPageSite(property_page[i], NULL);
311 if(property_page[i])
304 IPropertyPage_Release(property_page[i]);
312 IPropertyPage_Release(property_page[i]);
305 }
306 }
307
308 HeapFree(GetProcessHeap(), 0, dialogs);
309 HeapFree(GetProcessHeap(), 0, property_page);
310 HeapFree(GetProcessHeap(), 0, property_sheet.u3.phpage);
311 return S_OK;
312}
313

--- 24 unchanged lines hidden ---
313 }
314
315 HeapFree(GetProcessHeap(), 0, dialogs);
316 HeapFree(GetProcessHeap(), 0, property_page);
317 HeapFree(GetProcessHeap(), 0, property_sheet.u3.phpage);
318 return S_OK;
319}
320

--- 24 unchanged lines hidden ---