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
456e53bc
Commit
456e53bc
authored
Jan 28, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Optimize more nsAString handling.
parent
673c9038
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
25 deletions
+19
-25
editor.c
dlls/mshtml/editor.c
+6
-6
htmlbody.c
dlls/mshtml/htmlbody.c
+4
-9
htmldoc.c
dlls/mshtml/htmldoc.c
+1
-1
htmldoc3.c
dlls/mshtml/htmldoc3.c
+5
-6
htmldoc5.c
dlls/mshtml/htmldoc5.c
+1
-1
htmlelemcol.c
dlls/mshtml/htmlelemcol.c
+1
-1
htmlevent.c
dlls/mshtml/htmlevent.c
+1
-1
No files found.
dlls/mshtml/editor.c
View file @
456e53bc
...
...
@@ -298,7 +298,7 @@ static void get_font_size(HTMLDocument *This, WCHAR *ret)
TRACE
(
"found font tag %p
\n
"
,
elem
);
nsAString_Init
(
&
size_str
,
sizeW
);
nsAString_Init
Depend
(
&
size_str
,
sizeW
);
nsAString_Init
(
&
val_str
,
NULL
);
nsIDOMElement_GetAttribute
(
elem
,
&
size_str
,
&
val_str
);
...
...
@@ -360,10 +360,11 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
create_nselem
(
This
->
doc_node
,
fontW
,
&
elem
);
nsAString_Init
(
&
size_str
,
sizeW
);
nsAString_Init
(
&
val_str
,
size
);
nsAString_Init
Depend
(
&
size_str
,
sizeW
);
nsAString_Init
Depend
(
&
val_str
,
size
);
nsIDOMElement_SetAttribute
(
elem
,
&
size_str
,
&
val_str
);
nsAString_Finish
(
&
val_str
);
nsISelection_GetRangeAt
(
nsselection
,
0
,
&
range
);
nsISelection_GetIsCollapsed
(
nsselection
,
&
collapsed
);
...
...
@@ -384,7 +385,6 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
nsIDOMElement_Release
(
elem
);
nsAString_Finish
(
&
size_str
);
nsAString_Finish
(
&
val_str
);
set_dirty
(
This
,
VARIANT_TRUE
);
}
...
...
@@ -1167,8 +1167,8 @@ static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
/* create an element for the link */
create_nselem
(
This
->
doc_node
,
aW
,
&
anchor_elem
);
nsAString_Init
(
&
href_str
,
hrefW
);
nsAString_Init
(
&
ns_url
,
url
);
nsAString_Init
Depend
(
&
href_str
,
hrefW
);
nsAString_Init
Depend
(
&
ns_url
,
url
);
nsIDOMElement_SetAttribute
(
anchor_elem
,
&
href_str
,
&
ns_url
);
nsAString_Finish
(
&
href_str
);
...
...
dlls/mshtml/htmlbody.c
View file @
456e53bc
...
...
@@ -252,23 +252,18 @@ static HRESULT WINAPI HTMLBodyElement_Invoke(IHTMLBodyElement *iface, DISPID dis
static
HRESULT
WINAPI
HTMLBodyElement_put_background
(
IHTMLBodyElement
*
iface
,
BSTR
v
)
{
HTMLBodyElement
*
This
=
HTMLBODY_THIS
(
iface
);
HRESULT
hr
=
S_OK
;
nsAString
nsstr
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
nsAString_Init
(
&
nsstr
,
v
);
nsAString_InitDepend
(
&
nsstr
,
v
);
nsres
=
nsIDOMHTMLBodyElement_SetBackground
(
This
->
nsbody
,
&
nsstr
);
if
(
!
NS_SUCCEEDED
(
nsres
))
{
hr
=
E_FAIL
;
}
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
return
hr
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLBodyElement_get_background
(
IHTMLBodyElement
*
iface
,
BSTR
*
p
)
...
...
dlls/mshtml/htmldoc.c
View file @
456e53bc
...
...
@@ -348,7 +348,7 @@ static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v)
return
E_UNEXPECTED
;
}
nsAString_Init
(
&
nsstr
,
v
);
nsAString_Init
Depend
(
&
nsstr
,
v
);
nsres
=
nsIDOMHTMLDocument_SetTitle
(
This
->
doc_node
->
nsdoc
,
&
nsstr
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
...
...
dlls/mshtml/htmldoc3.c
View file @
456e53bc
...
...
@@ -116,7 +116,7 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t
return
E_UNEXPECTED
;
}
nsAString_Init
(
&
text_str
,
text
);
nsAString_Init
Depend
(
&
text_str
,
text
);
nsres
=
nsIDOMHTMLDocument_CreateTextNode
(
This
->
doc_node
->
nsdoc
,
&
text_str
,
&
nstext
);
nsAString_Finish
(
&
text_str
);
if
(
NS_FAILED
(
nsres
))
{
...
...
@@ -443,7 +443,7 @@ static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v
return
E_UNEXPECTED
;
}
nsAString_Init
(
&
id_str
,
v
);
nsAString_Init
Depend
(
&
id_str
,
v
);
/* get element by id attribute */
nsres
=
nsIDOMHTMLDocument_GetElementById
(
This
->
doc_node
->
nsdoc
,
&
id_str
,
&
nselem
);
if
(
FAILED
(
nsres
))
{
...
...
@@ -455,9 +455,9 @@ static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v
/* get first element by name attribute */
nsres
=
nsIDOMHTMLDocument_GetElementsByName
(
This
->
doc_node
->
nsdoc
,
&
id_str
,
&
nsnode_list
);
nsAString_Finish
(
&
id_str
);
if
(
FAILED
(
nsres
))
{
ERR
(
"getElementsByName failed: %08x
\n
"
,
nsres
);
nsAString_Finish
(
&
id_str
);
if
(
nsnode_by_id
)
nsIDOMNode_Release
(
nsnode_by_id
);
return
E_FAIL
;
...
...
@@ -465,7 +465,6 @@ static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v
nsIDOMNodeList_Item
(
nsnode_list
,
0
,
&
nsnode_by_name
);
nsIDOMNodeList_Release
(
nsnode_list
);
nsAString_Finish
(
&
id_str
);
if
(
nsnode_by_name
&&
nsnode_by_id
)
{
nsIDOM3Node
*
node3
;
...
...
@@ -528,8 +527,8 @@ static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface,
return
E_UNEXPECTED
;
}
nsAString_Init
(
&
id_str
,
v
);
nsAString_Init
(
&
ns_str
,
str
);
nsAString_Init
Depend
(
&
id_str
,
v
);
nsAString_Init
Depend
(
&
ns_str
,
str
);
nsres
=
nsIDOMHTMLDocument_GetElementsByTagNameNS
(
This
->
doc_node
->
nsdoc
,
&
ns_str
,
&
id_str
,
&
nslist
);
nsAString_Finish
(
&
id_str
);
nsAString_Finish
(
&
ns_str
);
...
...
dlls/mshtml/htmldoc5.c
View file @
456e53bc
...
...
@@ -136,7 +136,7 @@ static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bs
return
E_UNEXPECTED
;
}
nsAString_Init
(
&
str
,
bstrdata
);
nsAString_Init
Depend
(
&
str
,
bstrdata
);
nsres
=
nsIDOMHTMLDocument_CreateComment
(
This
->
doc_node
->
nsdoc
,
&
str
,
&
nscomment
);
nsAString_Finish
(
&
str
);
if
(
NS_FAILED
(
nsres
))
{
...
...
dlls/mshtml/htmlelemcol.c
View file @
456e53bc
...
...
@@ -245,7 +245,7 @@ static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
return
TRUE
;
}
nsAString_Init
(
&
nsname
,
nameW
);
nsAString_Init
Depend
(
&
nsname
,
nameW
);
nsres
=
nsIDOMHTMLElement_GetAttribute
(
elem
->
nselem
,
&
nsname
,
&
nsstr
);
nsAString_Finish
(
&
nsname
);
if
(
NS_SUCCEEDED
(
nsres
))
{
...
...
dlls/mshtml/htmlevent.c
View file @
456e53bc
...
...
@@ -743,7 +743,7 @@ static IHTMLEventObj *create_event(HTMLDOMNode *target, eventid_t eid, nsIDOMEve
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString
type_str
;
nsAString_Init
(
&
type_str
,
event_types
[
event_info
[
eid
].
type
]);
nsAString_Init
Depend
(
&
type_str
,
event_types
[
event_info
[
eid
].
type
]);
nsres
=
nsIDOMDocumentEvent_CreateEvent
(
doc_event
,
&
type_str
,
&
ret
->
nsevent
);
nsAString_Finish
(
&
type_str
);
nsIDOMDocumentEvent_Release
(
doc_event
);
...
...
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