oleaut: Fix VarFormat for VT_NULL variants.

This commit is contained in:
Robert Shearman 2006-03-05 13:36:56 +00:00 committed by Alexandre Julliard
parent 7406cc210b
commit 93acfeb7f0
2 changed files with 3 additions and 2 deletions

View File

@ -1785,10 +1785,8 @@ static void test_VarFormat(void)
/* VT_NULL */
V_VT(&in) = VT_NULL;
hres = pVarFormat(&in,NULL,fd,fw,0,&out);
todo_wine {
ok(hres == S_OK, "VarFormat failed with 0x%08lx\n", hres);
ok(out == NULL, "expected NULL formatted string\n");
}
/* Invalid args */
hres = pVarFormat(&in,NULL,fd,fw,flags,NULL);

View File

@ -2007,6 +2007,9 @@ HRESULT WINAPI VarFormatFromTokens(LPVARIANT pVarIn, LPOLESTR lpszFormat,
if (!pVarIn || !rgbTok)
return E_INVALIDARG;
if (V_VT(pVarIn) == VT_NULL)
return S_OK;
if (*rgbTok == FMT_TO_STRING || header->type == FMT_TYPE_GENERAL)
{
/* According to MSDN, general format acts somewhat like the 'Str'