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
a7c9fbc6
Commit
a7c9fbc6
authored
Feb 29, 2008
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Feb 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Implemented IXMLDOMText substringData.
parent
b2ad268a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
2 deletions
+85
-2
domdoc.c
dlls/msxml3/tests/domdoc.c
+46
-0
text.c
dlls/msxml3/text.c
+39
-2
No files found.
dlls/msxml3/tests/domdoc.c
View file @
a7c9fbc6
...
...
@@ -592,6 +592,52 @@ static void test_domdoc( void )
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"This &is a ; test <>
\\
"
)
),
"incorrect xml string
\n
"
);
SysFreeString
(
str
);
/* test substringData */
r
=
IXMLDOMText_substringData
(
nodetext
,
0
,
4
,
NULL
);
ok
(
r
==
E_INVALIDARG
,
"ret %08x
\n
"
,
r
);
/* test substringData - Invalid offset */
str
=
(
BSTR
)
&
szElement
;
r
=
IXMLDOMText_substringData
(
nodetext
,
-
1
,
4
,
&
str
);
ok
(
r
==
E_INVALIDARG
,
"ret %08x
\n
"
,
r
);
ok
(
str
==
NULL
,
"incorrect string
\n
"
);
/* test substringData - Invalid offset */
str
=
(
BSTR
)
&
szElement
;
r
=
IXMLDOMText_substringData
(
nodetext
,
30
,
0
,
&
str
);
ok
(
r
==
S_FALSE
,
"ret %08x
\n
"
,
r
);
ok
(
str
==
NULL
,
"incorrect string
\n
"
);
/* test substringData - Invalid size */
str
=
(
BSTR
)
&
szElement
;
r
=
IXMLDOMText_substringData
(
nodetext
,
0
,
-
1
,
&
str
);
ok
(
r
==
E_INVALIDARG
,
"ret %08x
\n
"
,
r
);
ok
(
str
==
NULL
,
"incorrect string
\n
"
);
/* test substringData - Invalid size */
str
=
(
BSTR
)
&
szElement
;
r
=
IXMLDOMText_substringData
(
nodetext
,
2
,
0
,
&
str
);
ok
(
r
==
S_FALSE
,
"ret %08x
\n
"
,
r
);
ok
(
str
==
NULL
,
"incorrect string
\n
"
);
/* test substringData - Start of string */
r
=
IXMLDOMText_substringData
(
nodetext
,
0
,
4
,
&
str
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"This"
)
),
"incorrect substringData string
\n
"
);
SysFreeString
(
str
);
/* test substringData - Middle of string */
r
=
IXMLDOMText_substringData
(
nodetext
,
13
,
4
,
&
str
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"test"
)
),
"incorrect substringData string
\n
"
);
SysFreeString
(
str
);
/* test substringData - End of string */
r
=
IXMLDOMText_substringData
(
nodetext
,
20
,
4
,
&
str
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"
\\
"
)
),
"incorrect substringData string
\n
"
);
SysFreeString
(
str
);
IXMLDOMText_Release
(
nodetext
);
}
SysFreeString
(
str
);
...
...
dlls/msxml3/text.c
View file @
a7c9fbc6
...
...
@@ -539,8 +539,45 @@ static HRESULT WINAPI domtext_substringData(
IXMLDOMText
*
iface
,
long
offset
,
long
count
,
BSTR
*
p
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
domtext
*
This
=
impl_from_IXMLDOMText
(
iface
);
xmlnode
*
pDOMNode
=
impl_from_IXMLDOMNode
(
(
IXMLDOMNode
*
)
This
->
element
);
xmlChar
*
pContent
;
long
nLength
=
0
;
HRESULT
hr
=
S_FALSE
;
TRACE
(
"%p
\n
"
,
iface
);
if
(
!
p
)
return
E_INVALIDARG
;
*
p
=
NULL
;
if
(
offset
<
0
||
count
<
0
)
return
E_INVALIDARG
;
if
(
count
==
0
)
return
hr
;
pContent
=
xmlNodeGetContent
(
pDOMNode
->
node
);
if
(
pContent
)
{
nLength
=
xmlStrlen
(
pContent
);
if
(
offset
<
nLength
)
{
BSTR
sContent
=
bstr_from_xmlChar
(
pContent
);
if
(
offset
+
count
>
nLength
)
*
p
=
SysAllocString
(
&
sContent
[
offset
]);
else
*
p
=
SysAllocStringLen
(
&
sContent
[
offset
],
count
);
SysFreeString
(
sContent
);
hr
=
S_OK
;
}
xmlFree
(
pContent
);
}
return
hr
;
}
static
HRESULT
WINAPI
domtext_appendData
(
...
...
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