Commit 622c94ac authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Support disabled escaping mode for characters() callback.

parent ca15adfd
...@@ -1109,7 +1109,7 @@ static HRESULT WINAPI SAXContentHandler_characters( ...@@ -1109,7 +1109,7 @@ static HRESULT WINAPI SAXContentHandler_characters(
if (nchars) if (nchars)
{ {
if (This->cdata) if (This->cdata || This->props[MXWriter_DisableEscaping] == VARIANT_TRUE)
write_output_buffer(This->buffer, chars, nchars); write_output_buffer(This->buffer, chars, nchars);
else else
{ {
......
...@@ -3248,6 +3248,7 @@ static void test_mxwriter_characters(void) ...@@ -3248,6 +3248,7 @@ static void test_mxwriter_characters(void)
{ {
ISAXContentHandler *content; ISAXContentHandler *content;
IMXWriter *writer; IMXWriter *writer;
VARIANT dest;
HRESULT hr; HRESULT hr;
if (!is_clsid_supported(table->clsid, mxwriter_support_data)) if (!is_clsid_supported(table->clsid, mxwriter_support_data))
...@@ -3276,17 +3277,41 @@ static void test_mxwriter_characters(void) ...@@ -3276,17 +3277,41 @@ static void test_mxwriter_characters(void)
/* test output */ /* test output */
if (hr == S_OK) if (hr == S_OK)
{ {
VARIANT dest;
V_VT(&dest) = VT_EMPTY; V_VT(&dest) = VT_EMPTY;
hr = IMXWriter_get_output(writer, &dest); hr = IMXWriter_get_output(writer, &dest);
EXPECT_HR(hr, S_OK); EXPECT_HR(hr, S_OK);
ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest));
ok(!lstrcmpW(_bstr_(table->output), V_BSTR(&dest)), ok(!lstrcmpW(_bstr_(table->output), V_BSTR(&dest)),
"test %d: got wrong content %s, expected %s\n", i, wine_dbgstr_w(V_BSTR(&dest)), table->output); "test %d: got wrong content %s, expected \"%s\"\n", i, wine_dbgstr_w(V_BSTR(&dest)), table->output);
VariantClear(&dest);
}
/* with disabled escaping */
V_VT(&dest) = VT_EMPTY;
hr = IMXWriter_put_output(writer, dest);
EXPECT_HR(hr, S_OK);
hr = IMXWriter_put_disableOutputEscaping(writer, VARIANT_TRUE);
EXPECT_HR(hr, S_OK);
hr = ISAXContentHandler_characters(content, _bstr_(table->data), strlen(table->data));
EXPECT_HR(hr, S_OK);
/* test output */
if (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_(table->data), V_BSTR(&dest)),
"test %d: got wrong content %s, expected \"%s\"\n", i, wine_dbgstr_w(V_BSTR(&dest)), table->data);
VariantClear(&dest); VariantClear(&dest);
} }
ISAXContentHandler_Release(content);
IMXWriter_Release(writer);
table++; table++;
i++; i++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment