mshtml: Added IHTMLTable::width property implementation. (try 4)
Jacek Caban
jacek at codeweavers.com
Sat Apr 26 07:44:54 CDT 2014
Hi Zhenbo,
This is better, but:
On 04/26/14 05:12, Zhenbo Li wrote:
> + hres = var2str(&v, &val);
> +
> + if (hres != S_OK){
> + ERR("Set Width(%s) failed when initializing a nsAString!\n",
> + debugstr_variant(&v));
> + nsAString_Finish(&val);
Again, this is not initialized in the error case.
> + return hres;
> + }
> +
> + nsres = nsIDOMHTMLTableElement_SetWidth(This->nstable, &val);
> + nsAString_Finish(&val);
> +
> + if (NS_FAILED(nsres)){
> + ERR("Set Width(%s) failed!\n", debugstr_variant(&v));
> + return E_FAIL;
> + }
> +
> + return S_OK;
> }
>
> static HRESULT WINAPI HTMLTable_get_width(IHTMLTable *iface, VARIANT *p)
> {
> HTMLTable *This = impl_from_IHTMLTable(iface);
> - FIXME("(%p)->(%p)\n", This, p);
> - return E_NOTIMPL;
> + nsAString val;
> + BSTR bstr;
> + nsresult nsres;
> + HRESULT hres;
> +
> + TRACE("(%p)->(%p)\n", This, p);
> + nsAString_Init(&val, NULL);
> + nsres = nsIDOMHTMLTableElement_GetWidth(This->nstable, &val);
> + if (NS_FAILED(nsres)){
> + ERR("Get Width(%s) failed!\n", debugstr_variant(p));
> + nsAString_Finish(&val);
> + return E_FAIL;
> + }
> +
> + hres = nsstr_to_truncated_bstr(&val, &bstr);
> + if (FAILED(hres)) {
> + SysFreeString(bstr);
And bstr is not initialized in error case.
Also, as Dmitry pointed, you don't check for some errors in var2str.
Jacek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20140426/148b79df/attachment.html>
More information about the wine-devel
mailing list