Commit 563bfdfc authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

riched20: Handle NULL in ITextServices::{TxGetHScroll, TxGetVScroll}.

parent 0c049b67
......@@ -990,6 +990,25 @@ static void test_default_format(void)
ITextHost_Release(host);
}
static void test_TxGetScroll(void)
{
ITextServices *txtserv;
ITextHost *host;
HRESULT ret;
if (!init_texthost(&txtserv, &host))
return;
ret = ITextServices_TxGetHScroll(txtserv, NULL, NULL, NULL, NULL, NULL);
ok(ret == S_OK, "ITextSerHices_GetVScroll failed: 0x%08x.\n", ret);
ret = ITextServices_TxGetVScroll(txtserv, NULL, NULL, NULL, NULL, NULL);
ok(ret == S_OK, "ITextServices_GetVScroll failed: 0x%08x.\n", ret);
ITextServices_Release(txtserv);
ITextHost_Release(host);
}
START_TEST( txtsrv )
{
ITextServices *txtserv;
......@@ -1021,6 +1040,7 @@ START_TEST( txtsrv )
test_TxDraw();
test_QueryInterface();
test_default_format();
test_TxGetScroll();
}
if (wrapperCodeMem) VirtualFree(wrapperCodeMem, 0, MEM_RELEASE);
}
......@@ -182,11 +182,16 @@ DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetHScroll(ITextServices *iface, LONG
{
ITextServicesImpl *This = impl_from_ITextServices(iface);
*plMin = This->editor->horz_si.nMin;
*plMax = This->editor->horz_si.nMax;
*plPos = This->editor->horz_si.nPos;
*plPage = This->editor->horz_si.nPage;
*pfEnabled = (This->editor->styleFlags & WS_HSCROLL) != 0;
if (plMin)
*plMin = This->editor->horz_si.nMin;
if (plMax)
*plMax = This->editor->horz_si.nMax;
if (plPos)
*plPos = This->editor->horz_si.nPos;
if (plPage)
*plPage = This->editor->horz_si.nPage;
if (pfEnabled)
*pfEnabled = (This->editor->styleFlags & WS_HSCROLL) != 0;
return S_OK;
}
......@@ -195,11 +200,16 @@ DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetVScroll(ITextServices *iface, LONG
{
ITextServicesImpl *This = impl_from_ITextServices(iface);
*plMin = This->editor->vert_si.nMin;
*plMax = This->editor->vert_si.nMax;
*plPos = This->editor->vert_si.nPos;
*plPage = This->editor->vert_si.nPage;
*pfEnabled = (This->editor->styleFlags & WS_VSCROLL) != 0;
if (plMin)
*plMin = This->editor->vert_si.nMin;
if (plMax)
*plMax = This->editor->vert_si.nMax;
if (plPos)
*plPos = This->editor->vert_si.nPos;
if (plPage)
*plPage = This->editor->vert_si.nPage;
if (pfEnabled)
*pfEnabled = (This->editor->styleFlags & WS_VSCROLL) != 0;
return S_OK;
}
......
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