Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
300c6460
Commit
300c6460
authored
Feb 12, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Return element as ndIDOMElement from create_nselem.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3e4565f5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
29 deletions
+21
-29
editor.c
dlls/mshtml/editor.c
+7
-7
htmlelem.c
dlls/mshtml/htmlelem.c
+4
-12
htmlimg.c
dlls/mshtml/htmlimg.c
+2
-2
htmloption.c
dlls/mshtml/htmloption.c
+2
-2
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-1
txtrange.c
dlls/mshtml/txtrange.c
+5
-5
No files found.
dlls/mshtml/editor.c
View file @
300c6460
...
...
@@ -324,7 +324,7 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
{
nsISelection
*
nsselection
;
cpp_bool
collapsed
;
nsIDOM
HTML
Element
*
elem
;
nsIDOMElement
*
elem
;
nsIDOMRange
*
range
;
LONG
range_cnt
=
0
;
nsAString
size_str
;
...
...
@@ -353,7 +353,7 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
nsAString_InitDepend
(
&
size_str
,
sizeW
);
nsAString_InitDepend
(
&
val_str
,
size
);
nsIDOM
HTML
Element_SetAttribute
(
elem
,
&
size_str
,
&
val_str
);
nsIDOMElement_SetAttribute
(
elem
,
&
size_str
,
&
val_str
);
nsAString_Finish
(
&
val_str
);
nsISelection_GetRangeAt
(
nsselection
,
0
,
&
range
);
...
...
@@ -372,7 +372,7 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
nsISelection_Release
(
nsselection
);
nsIDOMRange_Release
(
range
);
nsIDOM
HTML
Element_Release
(
elem
);
nsIDOMElement_Release
(
elem
);
nsAString_Finish
(
&
size_str
);
...
...
@@ -1106,7 +1106,7 @@ static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
{
nsAString
href_str
,
ns_url
;
nsIHTMLEditor
*
html_editor
;
nsIDOM
HTML
Element
*
anchor_elem
;
nsIDOMElement
*
anchor_elem
;
cpp_bool
insert_link_at_caret
;
nsISelection
*
nsselection
;
BSTR
url
=
NULL
;
...
...
@@ -1148,7 +1148,7 @@ static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
nsAString_InitDepend
(
&
href_str
,
hrefW
);
nsAString_InitDepend
(
&
ns_url
,
url
);
nsIDOM
HTML
Element_SetAttribute
(
anchor_elem
,
&
href_str
,
&
ns_url
);
nsIDOMElement_SetAttribute
(
anchor_elem
,
&
href_str
,
&
ns_url
);
nsAString_Finish
(
&
href_str
);
nsISelection_GetIsCollapsed
(
nsselection
,
&
insert_link_at_caret
);
...
...
@@ -1161,7 +1161,7 @@ static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
nsIDOMHTMLDocument_CreateTextNode
(
This
->
doc_node
->
nsdoc
,
&
ns_url
,
&
text_node
);
/* wrap the <a> tags around the text element */
nsIDOM
HTML
Element_AppendChild
(
anchor_elem
,
(
nsIDOMNode
*
)
text_node
,
&
unused_node
);
nsIDOMElement_AppendChild
(
anchor_elem
,
(
nsIDOMNode
*
)
text_node
,
&
unused_node
);
nsIDOMText_Release
(
text_node
);
nsIDOMNode_Release
(
unused_node
);
}
...
...
@@ -1184,7 +1184,7 @@ static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
}
nsISelection_Release
(
nsselection
);
nsIDOM
HTML
Element_Release
(
anchor_elem
);
nsIDOMElement_Release
(
anchor_elem
);
if
(
cmdexecopt
!=
OLECMDEXECOPT_DONTPROMPTUSER
)
SysFreeString
(
url
);
...
...
dlls/mshtml/htmlelem.c
View file @
300c6460
...
...
@@ -269,9 +269,8 @@ static inline HTMLElement *impl_from_IHTMLElement(IHTMLElement *iface)
return
CONTAINING_RECORD
(
iface
,
HTMLElement
,
IHTMLElement_iface
);
}
HRESULT
create_nselem
(
HTMLDocumentNode
*
doc
,
const
WCHAR
*
tag
,
nsIDOM
HTML
Element
**
ret
)
HRESULT
create_nselem
(
HTMLDocumentNode
*
doc
,
const
WCHAR
*
tag
,
nsIDOMElement
**
ret
)
{
nsIDOMElement
*
nselem
;
nsAString
tag_str
;
nsresult
nsres
;
...
...
@@ -281,26 +280,19 @@ HRESULT create_nselem(HTMLDocumentNode *doc, const WCHAR *tag, nsIDOMHTMLElement
}
nsAString_InitDepend
(
&
tag_str
,
tag
);
nsres
=
nsIDOMHTMLDocument_CreateElement
(
doc
->
nsdoc
,
&
tag_str
,
&
nselem
);
nsres
=
nsIDOMHTMLDocument_CreateElement
(
doc
->
nsdoc
,
&
tag_str
,
ret
);
nsAString_Finish
(
&
tag_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateElement failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMElement_QueryInterface
(
nselem
,
&
IID_nsIDOMHTMLElement
,
(
void
**
)
ret
);
nsIDOMElement_Release
(
nselem
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMHTMLElement iface: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
return
S_OK
;
}
HRESULT
create_element
(
HTMLDocumentNode
*
doc
,
const
WCHAR
*
tag
,
HTMLElement
**
ret
)
{
nsIDOM
HTML
Element
*
nselem
;
nsIDOMElement
*
nselem
;
HRESULT
hres
;
/* Use owner doc if called on document fragment */
...
...
@@ -312,7 +304,7 @@ HRESULT create_element(HTMLDocumentNode *doc, const WCHAR *tag, HTMLElement **re
return
hres
;
hres
=
HTMLElement_Create
(
doc
,
(
nsIDOMNode
*
)
nselem
,
TRUE
,
ret
);
nsIDOM
HTML
Element_Release
(
nselem
);
nsIDOMElement_Release
(
nselem
);
return
hres
;
}
...
...
dlls/mshtml/htmlimg.c
View file @
300c6460
...
...
@@ -874,7 +874,7 @@ static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *i
HTMLDocumentNode
*
doc
;
IHTMLImgElement
*
img
;
HTMLElement
*
elem
;
nsIDOM
HTML
Element
*
nselem
;
nsIDOMElement
*
nselem
;
LONG
l
;
HRESULT
hres
;
...
...
@@ -897,7 +897,7 @@ static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *i
return
hres
;
hres
=
HTMLElement_Create
(
doc
,
(
nsIDOMNode
*
)
nselem
,
FALSE
,
&
elem
);
nsIDOM
HTML
Element_Release
(
nselem
);
nsIDOMElement_Release
(
nselem
);
if
(
FAILED
(
hres
))
{
ERR
(
"HTMLElement_Create failed
\n
"
);
return
hres
;
...
...
dlls/mshtml/htmloption.c
View file @
300c6460
...
...
@@ -559,7 +559,7 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
IHTMLOptionElement
**
optelem
)
{
HTMLOptionElementFactory
*
This
=
impl_from_IHTMLOptionElementFactory
(
iface
);
nsIDOM
HTML
Element
*
nselem
;
nsIDOMElement
*
nselem
;
HTMLDOMNode
*
node
;
HRESULT
hres
;
...
...
@@ -580,7 +580,7 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
return
hres
;
hres
=
get_node
(
This
->
window
->
doc
,
(
nsIDOMNode
*
)
nselem
,
TRUE
,
&
node
);
nsIDOM
HTML
Element_Release
(
nselem
);
nsIDOMElement_Release
(
nselem
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/mshtml/mshtml_private.h
View file @
300c6460
...
...
@@ -979,7 +979,7 @@ void detach_ranges(HTMLDocumentNode*) DECLSPEC_HIDDEN;
HRESULT
get_node_text
(
HTMLDOMNode
*
,
BSTR
*
)
DECLSPEC_HIDDEN
;
HRESULT
replace_node_by_html
(
nsIDOMHTMLDocument
*
,
nsIDOMNode
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
HRESULT
create_nselem
(
HTMLDocumentNode
*
,
const
WCHAR
*
,
nsIDOM
HTML
Element
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_nselem
(
HTMLDocumentNode
*
,
const
WCHAR
*
,
nsIDOMElement
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_element
(
HTMLDocumentNode
*
,
const
WCHAR
*
,
HTMLElement
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLDOMTextNode_Create
(
HTMLDocumentNode
*
,
nsIDOMNode
*
,
HTMLDOMNode
**
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/txtrange.c
View file @
300c6460
...
...
@@ -1661,7 +1661,7 @@ static HRESULT WINAPI RangeCommandTarget_QueryStatus(IOleCommandTarget *iface, c
static
HRESULT
exec_indent
(
HTMLTxtRange
*
This
,
VARIANT
*
in
,
VARIANT
*
out
)
{
nsIDOM
HTML
Element
*
blockquote_elem
,
*
p_elem
;
nsIDOMElement
*
blockquote_elem
,
*
p_elem
;
nsIDOMDocumentFragment
*
fragment
;
nsIDOMNode
*
tmp
;
...
...
@@ -1679,16 +1679,16 @@ static HRESULT exec_indent(HTMLTxtRange *This, VARIANT *in, VARIANT *out)
create_nselem
(
This
->
doc
,
pW
,
&
p_elem
);
nsIDOMRange_ExtractContents
(
This
->
nsrange
,
&
fragment
);
nsIDOM
HTML
Element_AppendChild
(
p_elem
,
(
nsIDOMNode
*
)
fragment
,
&
tmp
);
nsIDOMElement_AppendChild
(
p_elem
,
(
nsIDOMNode
*
)
fragment
,
&
tmp
);
nsIDOMDocumentFragment_Release
(
fragment
);
nsIDOMNode_Release
(
tmp
);
nsIDOM
HTML
Element_AppendChild
(
blockquote_elem
,
(
nsIDOMNode
*
)
p_elem
,
&
tmp
);
nsIDOM
HTML
Element_Release
(
p_elem
);
nsIDOMElement_AppendChild
(
blockquote_elem
,
(
nsIDOMNode
*
)
p_elem
,
&
tmp
);
nsIDOMElement_Release
(
p_elem
);
nsIDOMNode_Release
(
tmp
);
nsIDOMRange_InsertNode
(
This
->
nsrange
,
(
nsIDOMNode
*
)
blockquote_elem
);
nsIDOM
HTML
Element_Release
(
blockquote_elem
);
nsIDOMElement_Release
(
blockquote_elem
);
return
S_OK
;
}
...
...
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