Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
541a49ed
Commit
541a49ed
authored
Dec 27, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: COM cleanup for all the IOleCommandTarget ifaces.
parent
389a7f54
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
24 deletions
+30
-24
htmldoc.c
dlls/mshtml/htmldoc.c
+1
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-2
olecmd.c
dlls/mshtml/olecmd.c
+14
-10
txtrange.c
dlls/mshtml/txtrange.c
+12
-9
view.c
dlls/mshtml/view.c
+2
-2
No files found.
dlls/mshtml/htmldoc.c
View file @
541a49ed
...
...
@@ -1776,7 +1776,7 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
*
ppv
=
&
This
->
IServiceProvider_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IOleCommandTarget
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleCommandTarget, %p)
\n
"
,
This
,
ppv
);
*
ppv
=
CMDTARGET
(
This
)
;
*
ppv
=
&
This
->
IOleCommandTarget_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IOleControl
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleControl, %p)
\n
"
,
This
,
ppv
);
*
ppv
=
CONTROL
(
This
);
...
...
dlls/mshtml/mshtml_private.h
View file @
541a49ed
...
...
@@ -358,7 +358,7 @@ struct HTMLDocument {
IViewObjectEx
IViewObjectEx_iface
;
IOleInPlaceObjectWindowless
IOleInPlaceObjectWindowless_iface
;
IServiceProvider
IServiceProvider_iface
;
const
IOleCommandTargetVtbl
*
lpOleCommandTargetVtbl
;
IOleCommandTarget
IOleCommandTarget_iface
;
const
IOleControlVtbl
*
lpOleControlVtbl
;
const
IHlinkTargetVtbl
*
lpHlinkTargetVtbl
;
IPersistStreamInit
IPersistStreamInit_iface
;
...
...
@@ -625,7 +625,6 @@ struct HTMLDocumentNode {
#define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
#define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
#define HTMLWINDOW4(x) ((IHTMLWindow4*) &(x)->lpHTMLWindow4Vtbl)
#define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
#define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
...
...
dlls/mshtml/olecmd.c
View file @
541a49ed
...
...
@@ -66,7 +66,10 @@ void do_ns_command(HTMLDocument *This, const char *cmd, nsICommandParams *nspara
* IOleCommandTarget implementation
*/
#define CMDTARGET_THIS(iface) DEFINE_THIS(HTMLDocument, OleCommandTarget, iface)
static
inline
HTMLDocument
*
impl_from_IOleCommandTarget
(
IOleCommandTarget
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLDocument
,
IOleCommandTarget_iface
);
}
static
HRESULT
exec_open
(
HTMLDocument
*
This
,
DWORD
nCmdexecopt
,
VARIANT
*
pvaIn
,
VARIANT
*
pvaOut
)
{
...
...
@@ -621,7 +624,7 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
if
(
This
->
doc_obj
->
hostui
)
IDocHostUIHandler_ShowUI
(
This
->
doc_obj
->
hostui
,
DOCHOSTUITYPE_AUTHOR
,
&
This
->
IOleInPlaceActiveObject_iface
,
CMDTARGET
(
This
)
,
&
This
->
IOleInPlaceActiveObject_iface
,
&
This
->
IOleCommandTarget_iface
,
This
->
doc_obj
->
frame
,
This
->
doc_obj
->
ip_window
);
if
(
This
->
doc_obj
->
ip_window
)
...
...
@@ -737,19 +740,19 @@ static const cmdtable_t base_cmds[] = {
static
HRESULT
WINAPI
OleCommandTarget_QueryInterface
(
IOleCommandTarget
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
HTMLDocument
*
This
=
CMDTARGET_THIS
(
iface
);
HTMLDocument
*
This
=
impl_from_IOleCommandTarget
(
iface
);
return
htmldoc_query_interface
(
This
,
riid
,
ppv
);
}
static
ULONG
WINAPI
OleCommandTarget_AddRef
(
IOleCommandTarget
*
iface
)
{
HTMLDocument
*
This
=
CMDTARGET_THIS
(
iface
);
HTMLDocument
*
This
=
impl_from_IOleCommandTarget
(
iface
);
return
htmldoc_addref
(
This
);
}
static
ULONG
WINAPI
OleCommandTarget_Release
(
IOleCommandTarget
*
iface
)
{
HTMLDocument
*
This
=
CMDTARGET_THIS
(
iface
);
HTMLDocument
*
This
=
impl_from_IOleCommandTarget
(
iface
);
return
htmldoc_release
(
This
);
}
...
...
@@ -771,7 +774,7 @@ static HRESULT query_from_table(HTMLDocument *This, const cmdtable_t *cmdtable,
static
HRESULT
WINAPI
OleCommandTarget_QueryStatus
(
IOleCommandTarget
*
iface
,
const
GUID
*
pguidCmdGroup
,
ULONG
cCmds
,
OLECMD
prgCmds
[],
OLECMDTEXT
*
pCmdText
)
{
HTMLDocument
*
This
=
CMDTARGET_THIS
(
iface
);
HTMLDocument
*
This
=
impl_from_IOleCommandTarget
(
iface
);
HRESULT
hres
=
S_OK
,
hr
;
TRACE
(
"(%p)->(%s %d %p %p)
\n
"
,
This
,
debugstr_guid
(
pguidCmdGroup
),
cCmds
,
prgCmds
,
pCmdText
);
...
...
@@ -854,7 +857,7 @@ static HRESULT exec_from_table(HTMLDocument *This, const cmdtable_t *cmdtable, D
static
HRESULT
WINAPI
OleCommandTarget_Exec
(
IOleCommandTarget
*
iface
,
const
GUID
*
pguidCmdGroup
,
DWORD
nCmdID
,
DWORD
nCmdexecopt
,
VARIANT
*
pvaIn
,
VARIANT
*
pvaOut
)
{
HTMLDocument
*
This
=
CMDTARGET_THIS
(
iface
);
HTMLDocument
*
This
=
impl_from_IOleCommandTarget
(
iface
);
if
(
!
pguidCmdGroup
)
{
if
(
nCmdID
<
OLECMDID_OPEN
||
nCmdID
>
OLECMDID_GETPRINTTEMPLATE
||
!
exec_table
[
nCmdID
].
func
)
{
...
...
@@ -901,7 +904,7 @@ void show_context_menu(HTMLDocumentObj *This, DWORD dwID, POINT *ppt, IDispatch
DWORD
cmdid
;
if
(
This
->
hostui
&&
S_OK
==
IDocHostUIHandler_ShowContextMenu
(
This
->
hostui
,
dwID
,
ppt
,
(
IUnknown
*
)
CMDTARGET
(
&
This
->
basedoc
)
,
elem
))
dwID
,
ppt
,
(
IUnknown
*
)
&
This
->
basedoc
.
IOleCommandTarget_iface
,
elem
))
return
;
menu_res
=
LoadMenuW
(
get_shdoclc
(),
MAKEINTRESOURCEW
(
IDR_BROWSE_CONTEXT_MENU
));
...
...
@@ -912,10 +915,11 @@ void show_context_menu(HTMLDocumentObj *This, DWORD dwID, POINT *ppt, IDispatch
DestroyMenu
(
menu_res
);
if
(
cmdid
)
IOleCommandTarget_Exec
(
CMDTARGET
(
&
This
->
basedoc
),
&
CGID_MSHTML
,
cmdid
,
0
,
NULL
,
NULL
);
IOleCommandTarget_Exec
(
&
This
->
basedoc
.
IOleCommandTarget_iface
,
&
CGID_MSHTML
,
cmdid
,
0
,
NULL
,
NULL
);
}
void
HTMLDocument_OleCmd_Init
(
HTMLDocument
*
This
)
{
This
->
lpOleCommandTarget
Vtbl
=
&
OleCommandTargetVtbl
;
This
->
IOleCommandTarget_iface
.
lp
Vtbl
=
&
OleCommandTargetVtbl
;
}
dlls/mshtml/txtrange.c
View file @
541a49ed
...
...
@@ -38,7 +38,7 @@ static const WCHAR hrW[] = {'h','r',0};
typedef
struct
{
const
IHTMLTxtRangeVtbl
*
lpHTMLTxtRangeVtbl
;
const
IOleCommandTargetVtbl
*
lpOleCommandTargetVtbl
;
IOleCommandTarget
IOleCommandTarget_iface
;
LONG
ref
;
...
...
@@ -1017,7 +1017,7 @@ static HRESULT WINAPI HTMLTxtRange_QueryInterface(IHTMLTxtRange *iface, REFIID r
*
ppv
=
HTMLTXTRANGE
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IOleCommandTarget
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleCommandTarget %p)
\n
"
,
This
,
ppv
);
*
ppv
=
CMDTARGET
(
This
)
;
*
ppv
=
&
This
->
IOleCommandTarget_iface
;
}
if
(
*
ppv
)
{
...
...
@@ -1755,30 +1755,33 @@ static const IHTMLTxtRangeVtbl HTMLTxtRangeVtbl = {
HTMLTxtRange_execCommandShowHelp
};
#define OLECMDTRG_THIS(iface) DEFINE_THIS(HTMLTxtRange, OleCommandTarget, iface)
static
inline
HTMLTxtRange
*
impl_from_IOleCommandTarget
(
IOleCommandTarget
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLTxtRange
,
IOleCommandTarget_iface
);
}
static
HRESULT
WINAPI
RangeCommandTarget_QueryInterface
(
IOleCommandTarget
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
HTMLTxtRange
*
This
=
OLECMDTRG_THIS
(
iface
);
HTMLTxtRange
*
This
=
impl_from_IOleCommandTarget
(
iface
);
return
IHTMLTxtRange_QueryInterface
(
HTMLTXTRANGE
(
This
),
riid
,
ppv
);
}
static
ULONG
WINAPI
RangeCommandTarget_AddRef
(
IOleCommandTarget
*
iface
)
{
HTMLTxtRange
*
This
=
OLECMDTRG_THIS
(
iface
);
HTMLTxtRange
*
This
=
impl_from_IOleCommandTarget
(
iface
);
return
IHTMLTxtRange_AddRef
(
HTMLTXTRANGE
(
This
));
}
static
ULONG
WINAPI
RangeCommandTarget_Release
(
IOleCommandTarget
*
iface
)
{
HTMLTxtRange
*
This
=
OLECMDTRG_THIS
(
iface
);
HTMLTxtRange
*
This
=
impl_from_IOleCommandTarget
(
iface
);
return
IHTMLTxtRange_Release
(
HTMLTXTRANGE
(
This
));
}
static
HRESULT
WINAPI
RangeCommandTarget_QueryStatus
(
IOleCommandTarget
*
iface
,
const
GUID
*
pguidCmdGroup
,
ULONG
cCmds
,
OLECMD
prgCmds
[],
OLECMDTEXT
*
pCmdText
)
{
HTMLTxtRange
*
This
=
OLECMDTRG_THIS
(
iface
);
HTMLTxtRange
*
This
=
impl_from_IOleCommandTarget
(
iface
);
FIXME
(
"(%p)->(%s %d %p %p)
\n
"
,
This
,
debugstr_guid
(
pguidCmdGroup
),
cCmds
,
prgCmds
,
pCmdText
);
return
E_NOTIMPL
;
}
...
...
@@ -1820,7 +1823,7 @@ static HRESULT exec_indent(HTMLTxtRange *This, VARIANT *in, VARIANT *out)
static
HRESULT
WINAPI
RangeCommandTarget_Exec
(
IOleCommandTarget
*
iface
,
const
GUID
*
pguidCmdGroup
,
DWORD
nCmdID
,
DWORD
nCmdexecopt
,
VARIANT
*
pvaIn
,
VARIANT
*
pvaOut
)
{
HTMLTxtRange
*
This
=
OLECMDTRG_THIS
(
iface
);
HTMLTxtRange
*
This
=
impl_from_IOleCommandTarget
(
iface
);
TRACE
(
"(%p)->(%s %d %x %p %p)
\n
"
,
This
,
debugstr_guid
(
pguidCmdGroup
),
nCmdID
,
nCmdexecopt
,
pvaIn
,
pvaOut
);
...
...
@@ -1858,7 +1861,7 @@ HRESULT HTMLTxtRange_Create(HTMLDocumentNode *doc, nsIDOMRange *nsrange, IHTMLTx
return
E_OUTOFMEMORY
;
ret
->
lpHTMLTxtRangeVtbl
=
&
HTMLTxtRangeVtbl
;
ret
->
lpOleCommandTarget
Vtbl
=
&
OleCommandTargetVtbl
;
ret
->
IOleCommandTarget_iface
.
lp
Vtbl
=
&
OleCommandTargetVtbl
;
ret
->
ref
=
1
;
if
(
nsrange
)
...
...
dlls/mshtml/view.c
View file @
541a49ed
...
...
@@ -658,8 +658,8 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
if
(
This
->
doc_obj
->
hostui
)
{
hres
=
IDocHostUIHandler_ShowUI
(
This
->
doc_obj
->
hostui
,
This
->
doc_obj
->
usermode
==
EDITMODE
?
DOCHOSTUITYPE_AUTHOR
:
DOCHOSTUITYPE_BROWSE
,
&
This
->
IOleInPlaceActiveObject_iface
,
CMDTARGET
(
This
),
This
->
doc_obj
->
fram
e
,
This
->
doc_obj
->
ip_window
);
&
This
->
IOleInPlaceActiveObject_iface
,
&
This
->
IOleCommandTarget_ifac
e
,
This
->
doc_obj
->
frame
,
This
->
doc_obj
->
ip_window
);
if
(
FAILED
(
hres
))
IDocHostUIHandler_HideUI
(
This
->
doc_obj
->
hostui
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment