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
8cefe9b0
Commit
8cefe9b0
authored
May 07, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Store raw text data passed through characters().
parent
630e5f81
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
6 deletions
+72
-6
msxml_private.h
dlls/msxml3/msxml_private.h
+12
-4
mxwriter.c
dlls/msxml3/mxwriter.c
+13
-2
saxreader.c
dlls/msxml3/tests/saxreader.c
+47
-0
No files found.
dlls/msxml3/msxml_private.h
View file @
8cefe9b0
...
...
@@ -389,17 +389,25 @@ static inline HRESULT return_null_bstr(BSTR *p)
return
S_FALSE
;
}
static
inline
xmlChar
*
xmlchar_from_wchar
(
LPCWSTR
str
)
static
inline
xmlChar
*
xmlchar_from_wchar
n
(
const
WCHAR
*
str
,
int
nchars
)
{
xmlChar
*
xmlstr
;
DWORD
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
DWORD
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
nchars
,
NULL
,
0
,
NULL
,
NULL
);
xmlstr
=
heap_alloc
(
len
);
xmlstr
=
heap_alloc
(
len
+
1
);
if
(
xmlstr
)
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
-
1
,
(
LPSTR
)
xmlstr
,
len
,
NULL
,
NULL
);
{
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
nchars
,
(
LPSTR
)
xmlstr
,
len
+
1
,
NULL
,
NULL
);
xmlstr
[
len
]
=
0
;
}
return
xmlstr
;
}
static
inline
xmlChar
*
xmlchar_from_wchar
(
const
WCHAR
*
str
)
{
return
xmlchar_from_wcharn
(
str
,
-
1
);
}
#endif
extern
IXMLDOMParseError
*
create_parseError
(
LONG
code
,
BSTR
url
,
BSTR
reason
,
BSTR
srcText
,
...
...
dlls/msxml3/mxwriter.c
View file @
8cefe9b0
...
...
@@ -636,8 +636,19 @@ static HRESULT WINAPI mxwriter_saxcontent_characters(
int
nchars
)
{
mxwriter
*
This
=
impl_from_ISAXContentHandler
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_wn
(
chars
,
nchars
));
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s:%d)
\n
"
,
This
,
debugstr_wn
(
chars
,
nchars
),
nchars
);
if
(
!
chars
)
return
E_INVALIDARG
;
if
(
nchars
)
{
xmlChar
*
s
=
xmlchar_from_wcharn
(
chars
,
nchars
);
xmlOutputBufferWriteString
(
This
->
buffer
,
(
char
*
)
s
);
heap_free
(
s
);
}
return
S_OK
;
}
static
HRESULT
WINAPI
mxwriter_saxcontent_ignorableWhitespace
(
...
...
dlls/msxml3/tests/saxreader.c
View file @
8cefe9b0
...
...
@@ -1285,6 +1285,52 @@ static void test_mxwriter_startendelement(void)
free_bstrs
();
}
static
void
test_mxwriter_characters
(
void
)
{
static
const
WCHAR
chardataW
[]
=
{
'T'
,
'E'
,
'S'
,
'T'
,
'C'
,
'H'
,
'A'
,
'R'
,
'D'
,
'A'
,
'T'
,
'A'
,
' '
,
'.'
,
0
};
ISAXContentHandler
*
content
;
IMXWriter
*
writer
;
VARIANT
dest
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_MXXMLWriter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMXWriter
,
(
void
**
)
&
writer
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
hr
=
IMXWriter_QueryInterface
(
writer
,
&
IID_ISAXContentHandler
,
(
void
**
)
&
content
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IMXWriter_put_omitXMLDeclaration
(
writer
,
VARIANT_TRUE
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ISAXContentHandler_startDocument
(
content
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ISAXContentHandler_characters
(
content
,
NULL
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
ISAXContentHandler_characters
(
content
,
chardataW
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ISAXContentHandler_characters
(
content
,
chardataW
,
sizeof
(
chardataW
)
/
sizeof
(
WCHAR
)
-
1
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_get_output
(
writer
,
&
dest
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
dest
)
==
VT_BSTR
,
"got %d
\n
"
,
V_VT
(
&
dest
));
ok
(
!
lstrcmpW
(
_bstr_
(
"TESTCHARDATA ."
),
V_BSTR
(
&
dest
)),
"got wrong content %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
dest
)));
VariantClear
(
&
dest
);
hr
=
ISAXContentHandler_endDocument
(
content
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ISAXContentHandler_Release
(
content
);
IMXWriter_Release
(
writer
);
free_bstrs
();
}
START_TEST
(
saxreader
)
{
ISAXXMLReader
*
reader
;
...
...
@@ -1317,6 +1363,7 @@ START_TEST(saxreader)
test_mxwriter_contenthandler
();
test_mxwriter_startenddocument
();
test_mxwriter_startendelement
();
test_mxwriter_characters
();
test_mxwriter_properties
();
test_mxwriter_flush
();
}
...
...
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