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
a0d1d8cd
Commit
a0d1d8cd
authored
Nov 24, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 25, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLDocument2::execCommand implementation.
parent
d90016ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
2 deletions
+75
-2
htmldoc.c
dlls/mshtml/htmldoc.c
+57
-2
dom.c
dlls/mshtml/tests/dom.c
+18
-0
No files found.
dlls/mshtml/htmldoc.c
View file @
a0d1d8cd
...
...
@@ -31,6 +31,7 @@
#include "ole2.h"
#include "perhist.h"
#include "mshtmdid.h"
#include "mshtmcid.h"
#include "wine/debug.h"
...
...
@@ -1095,6 +1096,40 @@ static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface)
return
S_OK
;
}
static
const
WCHAR
insertorderedlistW
[]
=
{
'i'
,
'n'
,
's'
,
'e'
,
'r'
,
't'
,
'o'
,
'r'
,
'd'
,
'e'
,
'r'
,
'e'
,
'd'
,
'l'
,
'i'
,
's'
,
't'
,
0
};
static
const
WCHAR
insertunorderedlistW
[]
=
{
'i'
,
'n'
,
's'
,
'e'
,
'r'
,
't'
,
'u'
,
'n'
,
'o'
,
'r'
,
'd'
,
'e'
,
'r'
,
'e'
,
'd'
,
'l'
,
'i'
,
's'
,
't'
,
0
};
static
const
WCHAR
outdentW
[]
=
{
'o'
,
'u'
,
't'
,
'd'
,
'e'
,
'n'
,
't'
,
0
};
static
const
WCHAR
respectvisibilityindesignW
[]
=
{
'r'
,
'e'
,
's'
,
'p'
,
'e'
,
'c'
,
't'
,
'v'
,
'i'
,
's'
,
'i'
,
'b'
,
'i'
,
'l'
,
'i'
,
't'
,
'y'
,
'i'
,
'n'
,
'd'
,
'e'
,
's'
,
'i'
,
'g'
,
'n'
,
0
};
static
const
struct
{
const
WCHAR
*
name
;
OLECMDID
id
;
}
command_names
[]
=
{
{
insertorderedlistW
,
IDM_ORDERLIST
},
{
insertunorderedlistW
,
IDM_UNORDERLIST
},
{
outdentW
,
IDM_OUTDENT
},
{
respectvisibilityindesignW
,
IDM_RESPECTVISIBILITY_INDESIGN
}
};
static
BOOL
cmdid_from_string
(
const
WCHAR
*
str
,
OLECMDID
*
cmdid
)
{
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
command_names
)
/
sizeof
(
*
command_names
);
i
++
)
{
if
(
!
strcmpiW
(
command_names
[
i
].
name
,
str
))
{
*
cmdid
=
command_names
[
i
].
id
;
return
TRUE
;
}
}
FIXME
(
"Unknown command %s
\n
"
,
debugstr_w
(
str
));
return
FALSE
;
}
static
HRESULT
WINAPI
HTMLDocument_queryCommandSupported
(
IHTMLDocument2
*
iface
,
BSTR
cmdID
,
VARIANT_BOOL
*
pfRet
)
{
...
...
@@ -1147,8 +1182,28 @@ static HRESULT WINAPI HTMLDocument_execCommand(IHTMLDocument2 *iface, BSTR cmdID
VARIANT_BOOL
showUI
,
VARIANT
value
,
VARIANT_BOOL
*
pfRet
)
{
HTMLDocument
*
This
=
impl_from_IHTMLDocument2
(
iface
);
FIXME
(
"(%p)->(%s %x %s %p)
\n
"
,
This
,
debugstr_w
(
cmdID
),
showUI
,
debugstr_variant
(
&
value
),
pfRet
);
return
E_NOTIMPL
;
OLECMDID
cmdid
;
VARIANT
ret
;
HRESULT
hres
;
TRACE
(
"(%p)->(%s %x %s %p)
\n
"
,
This
,
debugstr_w
(
cmdID
),
showUI
,
debugstr_variant
(
&
value
),
pfRet
);
if
(
!
cmdid_from_string
(
cmdID
,
&
cmdid
))
return
OLECMDERR_E_NOTSUPPORTED
;
V_VT
(
&
ret
)
=
VT_EMPTY
;
hres
=
IOleCommandTarget_Exec
(
&
This
->
IOleCommandTarget_iface
,
&
CGID_MSHTML
,
cmdid
,
showUI
?
0
:
OLECMDEXECOPT_DONTPROMPTUSER
,
&
value
,
&
ret
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
V_VT
(
&
ret
)
!=
VT_EMPTY
)
{
FIXME
(
"Handle ret %s
\n
"
,
debugstr_variant
(
&
ret
));
VariantClear
(
&
ret
);
}
*
pfRet
=
VARIANT_TRUE
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLDocument_execCommandShowHelp
(
IHTMLDocument2
*
iface
,
BSTR
cmdID
,
...
...
dlls/mshtml/tests/dom.c
View file @
a0d1d8cd
...
...
@@ -6005,8 +6005,10 @@ static void test_defaults(IHTMLDocument2 *doc)
IHTMLElement2
*
elem2
;
IHTMLElement
*
elem
;
IHTMLStyle
*
style
;
VARIANT
v
;
BSTR
str
;
LONG
l
;
VARIANT_BOOL
b
;
HRESULT
hres
;
IHTMLElementCollection
*
collection
;
...
...
@@ -6129,6 +6131,22 @@ static void test_defaults(IHTMLDocument2 *doc)
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IHTMLFiltersCollection
,
(
void
**
)
&
body
);
ok
(
hres
==
E_NOINTERFACE
,
"got interface IHTMLFiltersCollection
\n
"
);
str
=
a2bstr
(
"xxx"
);
b
=
100
;
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
IHTMLDocument2_execCommand
(
doc
,
str
,
FALSE
,
v
,
&
b
);
ok
(
hres
==
OLECMDERR_E_NOTSUPPORTED
||
hres
==
E_INVALIDARG
,
"execCommand failed: %08x, expected OLECMDERR_E_NOTSUPPORTED or E_INVALIDARG
\n
"
,
hres
);
SysFreeString
(
str
);
str
=
a2bstr
(
"respectvisibilityindesign"
);
b
=
100
;
V_VT
(
&
v
)
=
VT_BOOL
;
V_BOOL
(
&
v
)
=
VARIANT_TRUE
;
hres
=
IHTMLDocument2_execCommand
(
doc
,
str
,
FALSE
,
v
,
&
b
);
ok
(
hres
==
S_OK
,
"execCommand failed: %08x, expected DRAGDROP_E_NOTREGISTERED
\n
"
,
hres
);
SysFreeString
(
str
);
test_default_selection
(
doc
);
test_doc_title
(
doc
,
""
);
test_dom_implementation
(
doc
);
...
...
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