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
4e079d6b
Commit
4e079d6b
authored
Feb 16, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Initial implementation of transform() method.
parent
bb47bab7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
6 deletions
+39
-6
stylesheet.c
dlls/msxml3/stylesheet.c
+28
-6
domdoc.c
dlls/msxml3/tests/domdoc.c
+11
-0
No files found.
dlls/msxml3/stylesheet.c
View file @
4e079d6b
...
@@ -50,11 +50,12 @@ typedef struct _xslprocessor
...
@@ -50,11 +50,12 @@ typedef struct _xslprocessor
IXSLProcessor
IXSLProcessor_iface
;
IXSLProcessor
IXSLProcessor_iface
;
LONG
ref
;
LONG
ref
;
xsltemplate
*
stylesheet
;
IXMLDOMNode
*
input
;
IXMLDOMNode
*
input
;
IStream
*
output
;
IStream
*
output
;
}
xslprocessor
;
}
xslprocessor
;
static
HRESULT
XSLProcessor_create
(
IXSLProcessor
**
);
static
HRESULT
XSLProcessor_create
(
xsltemplate
*
,
IXSLProcessor
**
);
static
inline
xsltemplate
*
impl_from_IXSLTemplate
(
IXSLTemplate
*
iface
)
static
inline
xsltemplate
*
impl_from_IXSLTemplate
(
IXSLTemplate
*
iface
)
{
{
...
@@ -226,7 +227,7 @@ static HRESULT WINAPI xsltemplate_createProcessor( IXSLTemplate *iface,
...
@@ -226,7 +227,7 @@ static HRESULT WINAPI xsltemplate_createProcessor( IXSLTemplate *iface,
if
(
!
processor
)
return
E_INVALIDARG
;
if
(
!
processor
)
return
E_INVALIDARG
;
return
XSLProcessor_create
(
processor
);
return
XSLProcessor_create
(
This
,
processor
);
}
}
static
const
struct
IXSLTemplateVtbl
xsltemplate_vtbl
=
static
const
struct
IXSLTemplateVtbl
xsltemplate_vtbl
=
...
@@ -308,6 +309,7 @@ static ULONG WINAPI xslprocessor_Release( IXSLProcessor *iface )
...
@@ -308,6 +309,7 @@ static ULONG WINAPI xslprocessor_Release( IXSLProcessor *iface )
{
{
if
(
This
->
input
)
IXMLDOMNode_Release
(
This
->
input
);
if
(
This
->
input
)
IXMLDOMNode_Release
(
This
->
input
);
if
(
This
->
output
)
IStream_Release
(
This
->
output
);
if
(
This
->
output
)
IStream_Release
(
This
->
output
);
IXSLTemplate_Release
(
&
This
->
stylesheet
->
IXSLTemplate_iface
);
heap_free
(
This
);
heap_free
(
This
);
}
}
...
@@ -516,12 +518,30 @@ static HRESULT WINAPI xslprocessor_get_output(
...
@@ -516,12 +518,30 @@ static HRESULT WINAPI xslprocessor_get_output(
static
HRESULT
WINAPI
xslprocessor_transform
(
static
HRESULT
WINAPI
xslprocessor_transform
(
IXSLProcessor
*
iface
,
IXSLProcessor
*
iface
,
VARIANT_BOOL
*
pbool
)
VARIANT_BOOL
*
ret
)
{
{
xslprocessor
*
This
=
impl_from_IXSLProcessor
(
iface
);
xslprocessor
*
This
=
impl_from_IXSLProcessor
(
iface
);
HRESULT
hr
;
BSTR
p
;
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
pbool
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
ret
);
return
E_NOTIMPL
;
if
(
!
ret
)
return
E_INVALIDARG
;
hr
=
IXMLDOMNode_transformNode
(
This
->
input
,
This
->
stylesheet
->
node
,
&
p
);
if
(
hr
==
S_OK
)
{
ULONG
len
=
0
;
/* output to stream */
hr
=
IStream_Write
(
This
->
output
,
p
,
SysStringByteLen
(
p
),
&
len
);
*
ret
=
len
==
SysStringByteLen
(
p
)
?
VARIANT_TRUE
:
VARIANT_FALSE
;
SysFreeString
(
p
);
}
else
*
ret
=
VARIANT_FALSE
;
return
hr
;
}
}
static
HRESULT
WINAPI
xslprocessor_reset
(
IXSLProcessor
*
iface
)
static
HRESULT
WINAPI
xslprocessor_reset
(
IXSLProcessor
*
iface
)
...
@@ -601,7 +621,7 @@ static const struct IXSLProcessorVtbl xslprocessor_vtbl =
...
@@ -601,7 +621,7 @@ static const struct IXSLProcessorVtbl xslprocessor_vtbl =
xslprocessor_get_stylesheet
xslprocessor_get_stylesheet
};
};
HRESULT
XSLProcessor_create
(
IXSLProcessor
**
ppObj
)
HRESULT
XSLProcessor_create
(
xsltemplate
*
template
,
IXSLProcessor
**
ppObj
)
{
{
xslprocessor
*
This
;
xslprocessor
*
This
;
...
@@ -615,6 +635,8 @@ HRESULT XSLProcessor_create(IXSLProcessor **ppObj)
...
@@ -615,6 +635,8 @@ HRESULT XSLProcessor_create(IXSLProcessor **ppObj)
This
->
ref
=
1
;
This
->
ref
=
1
;
This
->
input
=
NULL
;
This
->
input
=
NULL
;
This
->
output
=
NULL
;
This
->
output
=
NULL
;
This
->
stylesheet
=
template
;
IXSLTemplate_AddRef
(
&
template
->
IXSLTemplate_iface
);
*
ppObj
=
&
This
->
IXSLProcessor_iface
;
*
ppObj
=
&
This
->
IXSLProcessor_iface
;
...
...
dlls/msxml3/tests/domdoc.c
View file @
4e079d6b
...
@@ -7724,9 +7724,17 @@ static void test_xsltemplate(void)
...
@@ -7724,9 +7724,17 @@ static void test_xsltemplate(void)
hr
=
IXSLTemplate_createProcessor
(
template
,
NULL
);
hr
=
IXSLTemplate_createProcessor
(
template
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ref
=
IXSLTemplate_AddRef
(
template
);
IXSLTemplate_Release
(
template
);
ok
(
ref
==
2
,
"got %d
\n
"
,
ref
);
hr
=
IXSLTemplate_createProcessor
(
template
,
&
processor
);
hr
=
IXSLTemplate_createProcessor
(
template
,
&
processor
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ref
=
IXSLTemplate_AddRef
(
template
);
IXSLTemplate_Release
(
template
);
ok
(
ref
==
3
,
"got %d
\n
"
,
ref
);
/* input no set yet */
/* input no set yet */
V_VT
(
&
v
)
=
VT_BSTR
;
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
NULL
;
V_BSTR
(
&
v
)
=
NULL
;
...
@@ -7756,6 +7764,9 @@ todo_wine {
...
@@ -7756,6 +7764,9 @@ todo_wine {
IStream_Release
(
stream
);
IStream_Release
(
stream
);
todo_wine
ok
(
ref
==
4
,
"got %d
\n
"
,
ref
);
todo_wine
ok
(
ref
==
4
,
"got %d
\n
"
,
ref
);
hr
=
IXSLProcessor_transform
(
processor
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
/* reset and check stream refcount */
/* reset and check stream refcount */
V_VT
(
&
v
)
=
VT_EMPTY
;
V_VT
(
&
v
)
=
VT_EMPTY
;
hr
=
IXSLProcessor_put_output
(
processor
,
v
);
hr
=
IXSLProcessor_put_output
(
processor
,
v
);
...
...
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