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
12f7e0aa
Commit
12f7e0aa
authored
Aug 21, 2008
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Code clean up.
parent
379e543b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
46 deletions
+44
-46
queryresult.c
dlls/msxml3/queryresult.c
+44
-46
No files found.
dlls/msxml3/queryresult.c
View file @
12f7e0aa
...
...
@@ -50,8 +50,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
#include <libxml/xpath.h>
static
const
struct
IXMLDOMNodeListVtbl
queryresult_vtbl
;
typedef
struct
_queryresult
{
const
struct
IXMLDOMNodeListVtbl
*
lpVtbl
;
...
...
@@ -66,50 +64,6 @@ static inline queryresult *impl_from_IXMLDOMNodeList( IXMLDOMNodeList *iface )
return
(
queryresult
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
queryresult
,
lpVtbl
));
}
HRESULT
queryresult_create
(
xmlNodePtr
node
,
LPWSTR
szQuery
,
IXMLDOMNodeList
**
out
)
{
queryresult
*
This
=
CoTaskMemAlloc
(
sizeof
(
queryresult
));
xmlXPathContextPtr
ctxt
=
xmlXPathNewContext
(
node
->
doc
);
xmlChar
*
str
=
xmlChar_from_wchar
(
szQuery
);
HRESULT
hr
;
TRACE
(
"(%p, %s, %p)
\n
"
,
node
,
wine_dbgstr_w
(
szQuery
),
out
);
*
out
=
NULL
;
if
(
This
==
NULL
||
ctxt
==
NULL
||
str
==
NULL
)
{
hr
=
E_OUTOFMEMORY
;
goto
cleanup
;
}
This
->
lpVtbl
=
&
queryresult_vtbl
;
This
->
ref
=
1
;
This
->
resultPos
=
0
;
This
->
node
=
node
;
xmldoc_add_ref
(
This
->
node
->
doc
);
ctxt
->
node
=
node
;
This
->
result
=
xmlXPathEval
(
str
,
ctxt
);
if
(
!
This
->
result
||
This
->
result
->
type
!=
XPATH_NODESET
)
{
hr
=
E_FAIL
;
goto
cleanup
;
}
*
out
=
(
IXMLDOMNodeList
*
)
This
;
hr
=
S_OK
;
TRACE
(
"found %d matches
\n
"
,
xmlXPathNodeSetGetLength
(
This
->
result
->
nodesetval
));
cleanup:
if
(
This
!=
NULL
&&
FAILED
(
hr
))
IXMLDOMNodeList_Release
(
(
IXMLDOMNodeList
*
)
&
This
->
lpVtbl
);
if
(
ctxt
!=
NULL
)
xmlXPathFreeContext
(
ctxt
);
HeapFree
(
GetProcessHeap
(),
0
,
str
);
return
hr
;
}
static
HRESULT
WINAPI
queryresult_QueryInterface
(
IXMLDOMNodeList
*
iface
,
...
...
@@ -343,4 +297,48 @@ static const struct IXMLDOMNodeListVtbl queryresult_vtbl =
queryresult__newEnum
,
};
HRESULT
queryresult_create
(
xmlNodePtr
node
,
LPWSTR
szQuery
,
IXMLDOMNodeList
**
out
)
{
queryresult
*
This
=
CoTaskMemAlloc
(
sizeof
(
queryresult
));
xmlXPathContextPtr
ctxt
=
xmlXPathNewContext
(
node
->
doc
);
xmlChar
*
str
=
xmlChar_from_wchar
(
szQuery
);
HRESULT
hr
;
TRACE
(
"(%p, %s, %p)
\n
"
,
node
,
wine_dbgstr_w
(
szQuery
),
out
);
*
out
=
NULL
;
if
(
This
==
NULL
||
ctxt
==
NULL
||
str
==
NULL
)
{
hr
=
E_OUTOFMEMORY
;
goto
cleanup
;
}
This
->
lpVtbl
=
&
queryresult_vtbl
;
This
->
ref
=
1
;
This
->
resultPos
=
0
;
This
->
node
=
node
;
xmldoc_add_ref
(
This
->
node
->
doc
);
ctxt
->
node
=
node
;
This
->
result
=
xmlXPathEval
(
str
,
ctxt
);
if
(
!
This
->
result
||
This
->
result
->
type
!=
XPATH_NODESET
)
{
hr
=
E_FAIL
;
goto
cleanup
;
}
*
out
=
(
IXMLDOMNodeList
*
)
This
;
hr
=
S_OK
;
TRACE
(
"found %d matches
\n
"
,
xmlXPathNodeSetGetLength
(
This
->
result
->
nodesetval
));
cleanup:
if
(
This
!=
NULL
&&
FAILED
(
hr
))
IXMLDOMNodeList_Release
(
(
IXMLDOMNodeList
*
)
&
This
->
lpVtbl
);
if
(
ctxt
!=
NULL
)
xmlXPathFreeContext
(
ctxt
);
HeapFree
(
GetProcessHeap
(),
0
,
str
);
return
hr
;
}
#endif
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