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
02066602
Commit
02066602
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: Implement ::replaceData() for Text, Comment and CDATA nodes.
parent
88d82187
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
246 additions
and
6 deletions
+246
-6
cdata.c
dlls/msxml3/cdata.c
+11
-2
comment.c
dlls/msxml3/comment.c
+11
-2
domdoc.c
dlls/msxml3/tests/domdoc.c
+213
-0
text.c
dlls/msxml3/text.c
+11
-2
No files found.
dlls/msxml3/cdata.c
View file @
02066602
...
...
@@ -705,8 +705,17 @@ static HRESULT WINAPI domcdata_replaceData(
IXMLDOMCDATASection
*
iface
,
LONG
offset
,
LONG
count
,
BSTR
p
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
domcdata
*
This
=
impl_from_IXMLDOMCDATASection
(
iface
);
HRESULT
hr
;
TRACE
(
"%p %d %d %s
\n
"
,
This
,
offset
,
count
,
debugstr_w
(
p
));
hr
=
IXMLDOMCDATASection_deleteData
(
iface
,
offset
,
count
);
if
(
hr
==
S_OK
)
hr
=
IXMLDOMCDATASection_insertData
(
iface
,
offset
,
p
);
return
hr
;
}
static
HRESULT
WINAPI
domcdata_splitText
(
...
...
dlls/msxml3/comment.c
View file @
02066602
...
...
@@ -713,8 +713,17 @@ static HRESULT WINAPI domcomment_replaceData(
IXMLDOMComment
*
iface
,
LONG
offset
,
LONG
count
,
BSTR
p
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
domcomment
*
This
=
impl_from_IXMLDOMComment
(
iface
);
HRESULT
hr
;
TRACE
(
"%p %d %d %s
\n
"
,
This
,
offset
,
count
,
debugstr_w
(
p
));
hr
=
IXMLDOMComment_deleteData
(
iface
,
offset
,
count
);
if
(
hr
==
S_OK
)
hr
=
IXMLDOMComment_insertData
(
iface
,
offset
,
p
);
return
hr
;
}
static
const
struct
IXMLDOMCommentVtbl
domcomment_vtbl
=
...
...
dlls/msxml3/tests/domdoc.c
View file @
02066602
...
...
@@ -967,6 +967,77 @@ static void test_domdoc( void )
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"99"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* ::replaceData() */
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
SysAllocString
(
szstr1
);
r
=
IXMLDOMText_put_nodeValue
(
nodetext
,
var
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
VariantClear
(
&
var
);
r
=
IXMLDOMText_replaceData
(
nodetext
,
6
,
0
,
NULL
);
ok
(
r
==
E_INVALIDARG
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMText_get_text
(
nodetext
,
&
str
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"str1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
r
=
IXMLDOMText_replaceData
(
nodetext
,
0
,
0
,
NULL
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMText_get_text
(
nodetext
,
&
str
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"str1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* NULL pointer means delete */
r
=
IXMLDOMText_replaceData
(
nodetext
,
0
,
1
,
NULL
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMText_get_text
(
nodetext
,
&
str
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"tr1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* empty string means delete */
r
=
IXMLDOMText_replaceData
(
nodetext
,
0
,
1
,
_bstr_
(
""
));
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMText_get_text
(
nodetext
,
&
str
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"r1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* zero count means insert */
r
=
IXMLDOMText_replaceData
(
nodetext
,
0
,
0
,
_bstr_
(
"a"
));
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMText_get_text
(
nodetext
,
&
str
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"ar1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
r
=
IXMLDOMText_replaceData
(
nodetext
,
0
,
2
,
NULL
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMText_insertData
(
nodetext
,
0
,
_bstr_
(
"m"
));
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMText_get_text
(
nodetext
,
&
str
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"m1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* nonempty string, count greater than its length */
r
=
IXMLDOMText_replaceData
(
nodetext
,
0
,
2
,
_bstr_
(
"a1.2"
));
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMText_get_text
(
nodetext
,
&
str
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"a1.2"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* nonempty string, count less than its length */
r
=
IXMLDOMText_replaceData
(
nodetext
,
0
,
1
,
_bstr_
(
"wine"
));
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMText_get_text
(
nodetext
,
&
str
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"wine1.2"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
IXMLDOMText_Release
(
nodetext
);
}
...
...
@@ -3393,6 +3464,77 @@ static void test_xmlTypes(void)
hr
=
IXMLDOMComment_deleteData
(
pComment
,
0
,
len
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
/* ::replaceData() */
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
SysAllocString
(
szstr1
);
hr
=
IXMLDOMComment_put_nodeValue
(
pComment
,
v
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
VariantClear
(
&
v
);
hr
=
IXMLDOMComment_replaceData
(
pComment
,
6
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMComment_get_text
(
pComment
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"str1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
hr
=
IXMLDOMComment_replaceData
(
pComment
,
0
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMComment_get_text
(
pComment
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"str1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* NULL pointer means delete */
hr
=
IXMLDOMComment_replaceData
(
pComment
,
0
,
1
,
NULL
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMComment_get_text
(
pComment
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"tr1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* empty string means delete */
hr
=
IXMLDOMComment_replaceData
(
pComment
,
0
,
1
,
_bstr_
(
""
));
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMComment_get_text
(
pComment
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"r1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* zero count means insert */
hr
=
IXMLDOMComment_replaceData
(
pComment
,
0
,
0
,
_bstr_
(
"a"
));
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMComment_get_text
(
pComment
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"ar1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
hr
=
IXMLDOMComment_replaceData
(
pComment
,
0
,
2
,
NULL
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMComment_insertData
(
pComment
,
0
,
_bstr_
(
"m"
));
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMComment_get_text
(
pComment
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"m1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* nonempty string, count greater than its length */
hr
=
IXMLDOMComment_replaceData
(
pComment
,
0
,
2
,
_bstr_
(
"a1.2"
));
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMComment_get_text
(
pComment
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"a1.2"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* nonempty string, count less than its length */
hr
=
IXMLDOMComment_replaceData
(
pComment
,
0
,
1
,
_bstr_
(
"wine"
));
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMComment_get_text
(
pComment
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"wine1.2"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
IXMLDOMComment_Release
(
pComment
);
}
...
...
@@ -3823,6 +3965,77 @@ static void test_xmlTypes(void)
hr
=
IXMLDOMCDATASection_deleteData
(
pCDataSec
,
0
,
len
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
/* ::replaceData() */
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
SysAllocString
(
szstr1
);
hr
=
IXMLDOMCDATASection_put_nodeValue
(
pCDataSec
,
v
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
VariantClear
(
&
v
);
hr
=
IXMLDOMCDATASection_replaceData
(
pCDataSec
,
6
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMCDATASection_get_text
(
pCDataSec
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"str1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
hr
=
IXMLDOMCDATASection_replaceData
(
pCDataSec
,
0
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMCDATASection_get_text
(
pCDataSec
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"str1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* NULL pointer means delete */
hr
=
IXMLDOMCDATASection_replaceData
(
pCDataSec
,
0
,
1
,
NULL
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMCDATASection_get_text
(
pCDataSec
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"tr1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* empty string means delete */
hr
=
IXMLDOMCDATASection_replaceData
(
pCDataSec
,
0
,
1
,
_bstr_
(
""
));
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMCDATASection_get_text
(
pCDataSec
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"r1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* zero count means insert */
hr
=
IXMLDOMCDATASection_replaceData
(
pCDataSec
,
0
,
0
,
_bstr_
(
"a"
));
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMCDATASection_get_text
(
pCDataSec
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"ar1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
hr
=
IXMLDOMCDATASection_replaceData
(
pCDataSec
,
0
,
2
,
NULL
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMCDATASection_insertData
(
pCDataSec
,
0
,
_bstr_
(
"m"
));
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMCDATASection_get_text
(
pCDataSec
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"m1"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* nonempty string, count greater than its length */
hr
=
IXMLDOMCDATASection_replaceData
(
pCDataSec
,
0
,
2
,
_bstr_
(
"a1.2"
));
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMCDATASection_get_text
(
pCDataSec
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"a1.2"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
/* nonempty string, count less than its length */
hr
=
IXMLDOMCDATASection_replaceData
(
pCDataSec
,
0
,
1
,
_bstr_
(
"wine"
));
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMCDATASection_get_text
(
pCDataSec
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"wine1.2"
)
),
"incorrect get_text string
\n
"
);
SysFreeString
(
str
);
IXMLDOMCDATASection_Release
(
pCDataSec
);
}
...
...
dlls/msxml3/text.c
View file @
02066602
...
...
@@ -706,8 +706,17 @@ static HRESULT WINAPI domtext_replaceData(
IXMLDOMText
*
iface
,
LONG
offset
,
LONG
count
,
BSTR
p
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
domtext
*
This
=
impl_from_IXMLDOMText
(
iface
);
HRESULT
hr
;
TRACE
(
"%p %d %d %s
\n
"
,
This
,
offset
,
count
,
debugstr_w
(
p
));
hr
=
IXMLDOMText_deleteData
(
iface
,
offset
,
count
);
if
(
hr
==
S_OK
)
hr
=
IXMLDOMText_insertData
(
iface
,
offset
,
p
);
return
hr
;
}
static
HRESULT
WINAPI
domtext_splitText
(
...
...
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