mshtml: Forward IHTMLTextContainer::get_scrollTop to IHTMLElement2.

This commit is contained in:
Jacek Caban 2008-07-28 22:02:45 +02:00 committed by Alexandre Julliard
parent 4d89c62eab
commit 985115d804
2 changed files with 14 additions and 3 deletions

View File

@ -128,8 +128,10 @@ static HRESULT WINAPI HTMLTextContainer_put_scrollTop(IHTMLTextContainer *iface,
static HRESULT WINAPI HTMLTextContainer_get_scrollTop(IHTMLTextContainer *iface, long *p)
{
HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return IHTMLElement2_get_scrollTop(HTMLELEM2(&This->element), p);
}
static HRESULT WINAPI HTMLTextContainer_put_scrollLeft(IHTMLTextContainer *iface, long v)

View File

@ -1018,13 +1018,22 @@ static long _elem_get_scroll_width(unsigned line, IUnknown *unk)
static long _elem_get_scroll_top(unsigned line, IUnknown *unk)
{
IHTMLElement2 *elem = _get_elem2_iface(line, unk);
long l = -1;
IHTMLTextContainer *txtcont;
long l = -1, l2 = -1;
HRESULT hres;
hres = IHTMLElement2_get_scrollTop(elem, &l);
ok_(__FILE__,line) (hres == S_OK, "get_scrollTop failed: %08x\n", hres);
IHTMLElement2_Release(elem);
hres = IUnknown_QueryInterface(unk, &IID_IHTMLTextContainer, (void**)&txtcont);
ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLTextContainer: %08x\n", hres);
hres = IHTMLTextContainer_get_scrollTop(txtcont, &l2);
IHTMLTextContainer_Release(txtcont);
ok_(__FILE__,line) (hres == S_OK, "IHTMLTextContainer::get_scrollTop failed: %ld\n", l2);
ok_(__FILE__,line) (l == l2, "unexpected top %ld, expected %ld\n", l2, l);
return l;
}