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
19c30897
Commit
19c30897
authored
Feb 16, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Simplify ::appendData() for Text, Comment and CDATA nodes.
parent
02066602
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
54 deletions
+53
-54
cdata.c
dlls/msxml3/cdata.c
+17
-13
comment.c
dlls/msxml3/comment.c
+18
-28
text.c
dlls/msxml3/text.c
+18
-13
No files found.
dlls/msxml3/cdata.c
View file @
19c30897
...
...
@@ -582,26 +582,30 @@ static HRESULT WINAPI domcdata_appendData(
BSTR
p
)
{
domcdata
*
This
=
impl_from_IXMLDOMCDATASection
(
iface
);
xmlChar
*
pContent
;
HRESULT
hr
=
S_FALSE
;
HRESULT
hr
;
BSTR
data
;
LONG
p_len
;
TRACE
(
"%p %p
\n
"
,
This
,
debugstr_w
(
p
));
/* Nothing to do if NULL or an Empty string passed in. */
if
(
SysStringLen
(
p
)
==
0
)
return
S_OK
;
if
((
p_len
=
SysStringLen
(
p
))
==
0
)
return
S_OK
;
pContent
=
xmlChar_from_wchar
(
p
);
if
(
pContent
)
hr
=
IXMLDOMCDATASection_get_data
(
iface
,
&
data
);
if
(
hr
==
S_OK
)
{
if
(
xmlTextConcat
(
This
->
node
.
node
,
pContent
,
SysStringLen
(
p
)
)
==
0
)
hr
=
S_OK
;
else
hr
=
E_FAIL
;
LONG
len
=
SysStringLen
(
data
);
BSTR
str
=
SysAllocStringLen
(
NULL
,
p_len
+
len
);
memcpy
(
str
,
data
,
len
*
sizeof
(
WCHAR
));
memcpy
(
&
str
[
len
],
p
,
p_len
*
sizeof
(
WCHAR
));
str
[
len
+
p_len
]
=
0
;
hr
=
IXMLDOMCDATASection_put_data
(
iface
,
str
);
SysFreeString
(
str
);
SysFreeString
(
data
);
}
else
hr
=
E_FAIL
;
heap_free
(
pContent
);
return
hr
;
}
...
...
dlls/msxml3/comment.c
View file @
19c30897
...
...
@@ -576,40 +576,30 @@ static HRESULT WINAPI domcomment_appendData(
BSTR
p
)
{
domcomment
*
This
=
impl_from_IXMLDOMComment
(
iface
);
xmlChar
*
pContent
;
HRESULT
hr
=
S_FALSE
;
HRESULT
hr
;
BSTR
data
;
LONG
p_len
;
TRACE
(
"%p
\n
"
,
iface
);
TRACE
(
"%p
%s
\n
"
,
This
,
debugstr_w
(
p
)
);
/* Nothing to do if NULL or an Empty string passed in. */
if
(
p
==
NULL
||
SysStringLen
(
p
)
==
0
)
return
S_OK
;
if
((
p_len
=
SysStringLen
(
p
))
==
0
)
return
S_OK
;
pContent
=
xmlChar_from_wchar
(
p
);
if
(
pContent
)
hr
=
IXMLDOMComment_get_data
(
iface
,
&
data
);
if
(
hr
==
S_OK
)
{
/* Older versions of libxml < 2.6.27 didn't correctly support
xmlTextConcat on Comment nodes. Fallback to setting the
contents directly if xmlTextConcat fails.
*/
if
(
xmlTextConcat
(
This
->
node
.
node
,
pContent
,
SysStringLen
(
p
)
)
==
0
)
hr
=
S_OK
;
else
{
xmlChar
*
pNew
;
pNew
=
xmlStrcat
(
xmlNodeGetContent
(
This
->
node
.
node
),
pContent
);
if
(
pNew
)
{
xmlNodeSetContent
(
This
->
node
.
node
,
pNew
);
hr
=
S_OK
;
}
else
hr
=
E_FAIL
;
}
HeapFree
(
GetProcessHeap
(),
0
,
pContent
);
LONG
len
=
SysStringLen
(
data
);
BSTR
str
=
SysAllocStringLen
(
NULL
,
p_len
+
len
);
memcpy
(
str
,
data
,
len
*
sizeof
(
WCHAR
));
memcpy
(
&
str
[
len
],
p
,
p_len
*
sizeof
(
WCHAR
));
str
[
len
+
p_len
]
=
0
;
hr
=
IXMLDOMComment_put_data
(
iface
,
str
);
SysFreeString
(
str
);
SysFreeString
(
data
);
}
else
hr
=
E_FAIL
;
return
hr
;
}
...
...
dlls/msxml3/text.c
View file @
19c30897
...
...
@@ -584,25 +584,30 @@ static HRESULT WINAPI domtext_appendData(
BSTR
p
)
{
domtext
*
This
=
impl_from_IXMLDOMText
(
iface
);
xmlChar
*
pContent
;
HRESULT
hr
=
S_FALSE
;
HRESULT
hr
;
BSTR
data
;
LONG
p_len
;
TRACE
(
"%p
\n
"
,
iface
);
TRACE
(
"%p
%s
\n
"
,
This
,
debugstr_w
(
p
)
);
/* Nothing to do if NULL or an Empty string passed in. */
if
(
SysStringLen
(
p
)
==
0
)
return
S_OK
;
if
(
(
p_len
=
SysStringLen
(
p
)
)
==
0
)
return
S_OK
;
pContent
=
xmlChar_from_wchar
(
p
);
if
(
pContent
)
hr
=
IXMLDOMText_get_data
(
iface
,
&
data
);
if
(
hr
==
S_OK
)
{
if
(
xmlTextConcat
(
This
->
node
.
node
,
pContent
,
SysStringLen
(
p
))
==
0
)
hr
=
S_OK
;
else
hr
=
E_FAIL
;
heap_free
(
pContent
);
LONG
len
=
SysStringLen
(
data
);
BSTR
str
=
SysAllocStringLen
(
NULL
,
p_len
+
len
);
memcpy
(
str
,
data
,
len
*
sizeof
(
WCHAR
));
memcpy
(
&
str
[
len
],
p
,
p_len
*
sizeof
(
WCHAR
));
str
[
len
+
p_len
]
=
0
;
hr
=
IXMLDOMText_put_data
(
iface
,
str
);
SysFreeString
(
str
);
SysFreeString
(
data
);
}
else
hr
=
E_FAIL
;
return
hr
;
}
...
...
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