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
acce94a0
Commit
acce94a0
authored
Jun 23, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Implement internalEntityDecl() for writer.
parent
d20e4877
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
6 deletions
+43
-6
mxwriter.c
dlls/msxml3/mxwriter.c
+22
-6
saxreader.c
dlls/msxml3/tests/saxreader.c
+21
-0
No files found.
dlls/msxml3/mxwriter.c
View file @
acce94a0
...
...
@@ -42,6 +42,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
static
const
WCHAR
emptyW
[]
=
{
0
};
static
const
WCHAR
spaceW
[]
=
{
' '
};
static
const
WCHAR
quotW
[]
=
{
'\"'
};
static
const
WCHAR
closetagW
[]
=
{
'>'
,
'\r'
,
'\n'
};
/* should be ordered as encoding names are sorted */
typedef
enum
...
...
@@ -1455,7 +1456,6 @@ static HRESULT WINAPI SAXDeclHandler_elementDecl(ISAXDeclHandler *iface,
const
WCHAR
*
name
,
int
n_name
,
const
WCHAR
*
model
,
int
n_model
)
{
static
const
WCHAR
elementW
[]
=
{
'<'
,
'!'
,
'E'
,
'L'
,
'E'
,
'M'
,
'E'
,
'N'
,
'T'
,
' '
};
static
const
WCHAR
closeelementW
[]
=
{
'>'
,
'\r'
,
'\n'
};
mxwriter
*
This
=
impl_from_ISAXDeclHandler
(
iface
);
TRACE
(
"(%p)->(%s:%d %s:%d)
\n
"
,
This
,
debugstr_wn
(
name
,
n_name
),
n_name
,
...
...
@@ -1470,7 +1470,7 @@ static HRESULT WINAPI SAXDeclHandler_elementDecl(ISAXDeclHandler *iface,
}
if
(
n_model
)
write_output_buffer
(
This
->
buffer
,
model
,
n_model
);
write_output_buffer
(
This
->
buffer
,
close
elementW
,
sizeof
(
closeelement
W
)
/
sizeof
(
WCHAR
));
write_output_buffer
(
This
->
buffer
,
close
tagW
,
sizeof
(
closetag
W
)
/
sizeof
(
WCHAR
));
return
S_OK
;
}
...
...
@@ -1482,7 +1482,7 @@ static HRESULT WINAPI SAXDeclHandler_attributeDecl(ISAXDeclHandler *iface,
{
mxwriter
*
This
=
impl_from_ISAXDeclHandler
(
iface
);
static
const
WCHAR
attlistW
[]
=
{
'<'
,
'!'
,
'A'
,
'T'
,
'T'
,
'L'
,
'I'
,
'S'
,
'T'
,
' '
};
static
const
WCHAR
close
element
W
[]
=
{
'>'
,
'\r'
,
'\n'
};
static
const
WCHAR
close
tag
W
[]
=
{
'>'
,
'\r'
,
'\n'
};
TRACE
(
"(%p)->(%s:%d %s:%d %s:%d %s:%d %s:%d)
\n
"
,
This
,
debugstr_wn
(
element
,
n_element
),
n_element
,
debugstr_wn
(
attr
,
n_attr
),
n_attr
,
debugstr_wn
(
type
,
n_type
),
n_type
,
debugstr_wn
(
Default
,
n_default
),
n_default
,
...
...
@@ -1512,7 +1512,7 @@ static HRESULT WINAPI SAXDeclHandler_attributeDecl(ISAXDeclHandler *iface,
if
(
n_value
)
write_output_buffer_quoted
(
This
->
buffer
,
value
,
n_value
);
write_output_buffer
(
This
->
buffer
,
close
elementW
,
sizeof
(
closeelement
W
)
/
sizeof
(
WCHAR
));
write_output_buffer
(
This
->
buffer
,
close
tagW
,
sizeof
(
closetag
W
)
/
sizeof
(
WCHAR
));
return
S_OK
;
}
...
...
@@ -1521,9 +1521,25 @@ static HRESULT WINAPI SAXDeclHandler_internalEntityDecl(ISAXDeclHandler *iface,
const
WCHAR
*
name
,
int
n_name
,
const
WCHAR
*
value
,
int
n_value
)
{
mxwriter
*
This
=
impl_from_ISAXDeclHandler
(
iface
);
FIXME
(
"(%p)->(%s:%d %s:%d): stub
\n
"
,
This
,
debugstr_wn
(
name
,
n_name
),
n_name
,
static
const
WCHAR
entityW
[]
=
{
'<'
,
'!'
,
'E'
,
'N'
,
'T'
,
'I'
,
'T'
,
'Y'
,
' '
};
TRACE
(
"(%p)->(%s:%d %s:%d)
\n
"
,
This
,
debugstr_wn
(
name
,
n_name
),
n_name
,
debugstr_wn
(
value
,
n_value
),
n_value
);
return
E_NOTIMPL
;
if
(
!
name
||
!
value
)
return
E_INVALIDARG
;
write_output_buffer
(
This
->
buffer
,
entityW
,
sizeof
(
entityW
)
/
sizeof
(
WCHAR
));
if
(
n_name
)
{
write_output_buffer
(
This
->
buffer
,
name
,
n_name
);
write_output_buffer
(
This
->
buffer
,
spaceW
,
sizeof
(
spaceW
)
/
sizeof
(
WCHAR
));
}
if
(
n_value
)
write_output_buffer_quoted
(
This
->
buffer
,
value
,
n_value
);
write_output_buffer
(
This
->
buffer
,
closetagW
,
sizeof
(
closetagW
)
/
sizeof
(
WCHAR
));
return
S_OK
;
}
static
HRESULT
WINAPI
SAXDeclHandler_externalEntityDecl
(
ISAXDeclHandler
*
iface
,
...
...
dlls/msxml3/tests/saxreader.c
View file @
acce94a0
...
...
@@ -4488,6 +4488,27 @@ static void test_mxwriter_dtd(void)
V_BSTR
(
&
dest
)),
"got wrong content %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
dest
)));
VariantClear
(
&
dest
);
/* internal entities */
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_put_output
(
writer
,
dest
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
ISAXDeclHandler_internalEntityDecl
(
decl
,
NULL
,
0
,
NULL
,
0
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
ISAXDeclHandler_internalEntityDecl
(
decl
,
_bstr_
(
"name"
),
-
1
,
NULL
,
0
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
ISAXDeclHandler_internalEntityDecl
(
decl
,
_bstr_
(
"name"
),
strlen
(
"name"
),
_bstr_
(
"value"
),
strlen
(
"value"
));
EXPECT_HR
(
hr
,
S_OK
);
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_get_output
(
writer
,
&
dest
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
V_VT
(
&
dest
)
==
VT_BSTR
,
"got %d
\n
"
,
V_VT
(
&
dest
));
ok
(
!
lstrcmpW
(
_bstr_
(
"<!ENTITY name
\"
value
\"
>
\r\n
"
),
V_BSTR
(
&
dest
)),
"got wrong content %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
dest
)));
VariantClear
(
&
dest
);
ISAXContentHandler_Release
(
content
);
ISAXLexicalHandler_Release
(
lexical
);
ISAXDeclHandler_Release
(
decl
);
...
...
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