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
20e63dcf
Commit
20e63dcf
authored
Jan 15, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: In IXMLElementCollection store pointer to node instead of pointer to children.
Collection should be able to track node removal from children list.
parent
7f5cedf7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
xmlelem.c
dlls/msxml3/tests/xmlelem.c
+1
-1
xmlelem.c
dlls/msxml3/xmlelem.c
+22
-14
No files found.
dlls/msxml3/tests/xmlelem.c
View file @
20e63dcf
...
...
@@ -483,7 +483,7 @@ static void test_xmlelem_children(void)
length
=
-
1
;
hr
=
IXMLElementCollection_get_length
(
collection
,
&
length
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
todo_wine
ok
(
length
==
0
,
"Expected 0, got %08x
\n
"
,
length
);
ok
(
length
==
0
,
"Expected 0, got %08x
\n
"
,
length
);
IXMLElementCollection_Release
(
collection
);
hr
=
IXMLElement_AddRef
(
child
);
...
...
dlls/msxml3/xmlelem.c
View file @
20e63dcf
...
...
@@ -316,7 +316,7 @@ static HRESULT WINAPI xmlelem_get_children(IXMLElement *iface, IXMLElementCollec
if
(
!
p
)
return
E_INVALIDARG
;
return
XMLElementCollection_create
((
IUnknown
*
)
iface
,
This
->
node
->
children
,
(
LPVOID
*
)
p
);
return
XMLElementCollection_create
((
IUnknown
*
)
iface
,
This
->
node
,
(
LPVOID
*
)
p
);
}
static
LONG
type_libxml_to_msxml
(
xmlElementType
type
)
...
...
@@ -492,6 +492,19 @@ typedef struct _xmlelem_collection
xmlNodePtr
current
;
}
xmlelem_collection
;
static
inline
LONG
xmlelem_collection_updatelength
(
xmlelem_collection
*
collection
)
{
xmlNodePtr
ptr
=
collection
->
node
->
children
;
collection
->
length
=
0
;
while
(
ptr
)
{
collection
->
length
++
;
ptr
=
ptr
->
next
;
}
return
collection
->
length
;
}
static
inline
xmlelem_collection
*
impl_from_IXMLElementCollection
(
IXMLElementCollection
*
iface
)
{
return
(
xmlelem_collection
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
xmlelem_collection
,
lpVtbl
));
...
...
@@ -596,7 +609,7 @@ static HRESULT WINAPI xmlelem_collection_get_length(IXMLElementCollection *iface
if
(
!
p
)
return
E_INVALIDARG
;
*
p
=
This
->
length
;
*
p
=
xmlelem_collection_updatelength
(
This
)
;
return
S_OK
;
}
...
...
@@ -618,7 +631,7 @@ static HRESULT WINAPI xmlelem_collection_item(IXMLElementCollection *iface, VARI
VARIANT
var2
,
IDispatch
**
ppDisp
)
{
xmlelem_collection
*
This
=
impl_from_IXMLElementCollection
(
iface
);
xmlNodePtr
ptr
=
This
->
node
;
xmlNodePtr
ptr
=
This
->
node
->
children
;
int
index
,
i
;
TRACE
(
"(%p, %p)
\n
"
,
iface
,
ppDisp
);
...
...
@@ -631,6 +644,8 @@ static HRESULT WINAPI xmlelem_collection_item(IXMLElementCollection *iface, VARI
index
=
V_I4
(
&
var1
);
if
(
index
<
0
)
return
E_INVALIDARG
;
xmlelem_collection_updatelength
(
This
);
if
(
index
>=
This
->
length
)
return
E_FAIL
;
...
...
@@ -711,7 +726,7 @@ static HRESULT WINAPI xmlelem_collection_IEnumVARIANT_Reset(
IEnumVARIANT
*
iface
)
{
xmlelem_collection
*
This
=
impl_from_IEnumVARIANT
(
iface
);
This
->
current
=
This
->
node
;
This
->
current
=
This
->
node
->
children
;
return
S_OK
;
}
...
...
@@ -736,13 +751,12 @@ static const struct IEnumVARIANTVtbl xmlelem_collection_IEnumVARIANTvtbl =
static
HRESULT
XMLElementCollection_create
(
IUnknown
*
pUnkOuter
,
xmlNodePtr
node
,
LPVOID
*
ppObj
)
{
xmlelem_collection
*
collection
;
xmlNodePtr
ptr
;
TRACE
(
"(%p,%p)
\n
"
,
pUnkOuter
,
ppObj
);
*
ppObj
=
NULL
;
if
(
!
node
)
if
(
!
node
->
children
)
return
S_FALSE
;
collection
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
collection
));
...
...
@@ -754,14 +768,8 @@ static HRESULT XMLElementCollection_create(IUnknown *pUnkOuter, xmlNodePtr node,
collection
->
ref
=
1
;
collection
->
length
=
0
;
collection
->
node
=
node
;
collection
->
current
=
node
;
ptr
=
node
;
while
(
ptr
)
{
collection
->
length
++
;
ptr
=
ptr
->
next
;
}
collection
->
current
=
node
->
children
;
xmlelem_collection_updatelength
(
collection
);
*
ppObj
=
&
collection
->
lpVtbl
;
...
...
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