Jacek Caban : shdocvw:
Move inplace activating code to the separated function.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue May 23 15:22:42 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 864bfd8ead3f1bf005bfa493ce7c1efbf8603fbe
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=864bfd8ead3f1bf005bfa493ce7c1efbf8603fbe
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue May 23 20:04:56 2006 +0200
shdocvw: Move inplace activating code to the separated function.
---
dlls/shdocvw/oleobject.c | 106 +++++++++++++++++++++++++---------------------
1 files changed, 58 insertions(+), 48 deletions(-)
diff --git a/dlls/shdocvw/oleobject.c b/dlls/shdocvw/oleobject.c
index cf9e867..074da8d 100644
--- a/dlls/shdocvw/oleobject.c
+++ b/dlls/shdocvw/oleobject.c
@@ -99,6 +99,59 @@ static void create_shell_embedding_hwnd(
NULL, shdocvw_hinstance, This);
}
+static HRESULT activate_inplace(WebBrowser *This, IOleClientSite *active_site, HWND parent_hwnd)
+{
+ HRESULT hres;
+
+ if(!active_site)
+ return E_INVALIDARG;
+
+ if(This->inplace) {
+ IOleInPlaceSite_Release(This->inplace);
+ This->inplace = NULL;
+ }
+
+ hres = IOleClientSite_QueryInterface(active_site, &IID_IOleInPlaceSite,
+ (void**)&This->inplace);
+ if(FAILED(hres)) {
+ WARN("Could not get IOleInPlaceSite\n");
+ return hres;
+ }
+
+ hres = IOleInPlaceSite_CanInPlaceActivate(This->inplace);
+ if(hres != S_OK) {
+ WARN("CanInPlaceActivate returned: %08lx\n", hres);
+ IOleInPlaceSite_Release(This->inplace);
+ return E_FAIL;
+ }
+
+ hres = IOleInPlaceSite_GetWindow(This->inplace, &This->iphwnd);
+ if(FAILED(hres))
+ This->iphwnd = parent_hwnd;
+
+ IOleInPlaceSite_OnInPlaceActivate(This->inplace);
+
+ IOleInPlaceSite_GetWindowContext(This->inplace, &This->frame, &This->uiwindow,
+ &This->pos_rect, &This->clip_rect,
+ &This->frameinfo);
+
+ SetWindowPos(This->shell_embedding_hwnd, NULL,
+ This->pos_rect.left, This->pos_rect.top,
+ This->pos_rect.right-This->pos_rect.left,
+ This->pos_rect.bottom-This->pos_rect.top,
+ SWP_NOZORDER | SWP_SHOWWINDOW);
+
+ if(This->client) {
+ IOleClientSite_ShowObject(This->client);
+ IOleClientSite_GetContainer(This->client, &This->container);
+ }
+
+ if(This->frame)
+ IOleInPlaceFrame_GetWindow(This->frame, &This->frame_hwnd);
+
+ return S_OK;
+}
+
/**********************************************************************
* Implement the IOleObject interface for the WebBrowser control
*/
@@ -247,59 +300,16 @@ static HRESULT WINAPI OleObject_DoVerb(I
switch (iVerb)
{
- case OLEIVERB_SHOW:
case OLEIVERB_INPLACEACTIVATE:
TRACE("OLEIVERB_INPLACEACTIVATE\n");
+ return activate_inplace(This, pActiveSite, hwndParent);
- if(!pActiveSite)
- return E_INVALIDARG;
-
- if(This->inplace) {
- IOleInPlaceSite_Release(This->inplace);
- This->inplace = NULL;
- }
-
- hres = IOleClientSite_QueryInterface(pActiveSite, &IID_IOleInPlaceSite, (void**)&This->inplace);
- if(FAILED(hres)) {
- WARN("Could not get IOleInPlaceSite\n");
- return hres;
- }
-
- hres = IOleInPlaceSite_CanInPlaceActivate(This->inplace);
- if(hres != S_OK) {
- WARN("CanInPlaceActivate returned: %08lx\n", hres);
- IOleInPlaceSite_Release(This->inplace);
- return E_FAIL;
- }
+ case OLEIVERB_SHOW:
+ TRACE("OLEIVERB_SHOW\n");
- hres = IOleInPlaceSite_GetWindow(This->inplace, &This->iphwnd);
+ hres = activate_inplace(This, pActiveSite, hwndParent);
if(FAILED(hres))
- This->iphwnd = hwndParent;
-
- IOleInPlaceSite_OnInPlaceActivate(This->inplace);
-
- IOleInPlaceSite_GetWindowContext(This->inplace, &This->frame, &This->uiwindow,
- &This->pos_rect, &This->clip_rect,
- &This->frameinfo);
-
- SetWindowPos(This->shell_embedding_hwnd, NULL,
- This->pos_rect.left, This->pos_rect.top,
- This->pos_rect.right-This->pos_rect.left,
- This->pos_rect.bottom-This->pos_rect.top,
- SWP_NOZORDER | SWP_SHOWWINDOW);
-
- if(This->client) {
- IOleClientSite_ShowObject(This->client);
- IOleClientSite_GetContainer(This->client, &This->container);
- }
-
- if(This->frame)
- IOleInPlaceFrame_GetWindow(This->frame, &This->frame_hwnd);
-
- if(iVerb == OLEIVERB_INPLACEACTIVATE)
- return S_OK;
-
- TRACE("OLEIVERB_SHOW\n");
+ return hres;
IOleInPlaceSite_OnUIActivate(This->inplace);
More information about the wine-cvs
mailing list