Commit 615615b0 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

OleCreateFontIndirect(NULL,...) uses the OLE StdFont.

Added testcase for OleCreateFontIndirect(NULL). Added VT_NULL -> VT_BOOL variant converter.
parent dc4b0c76
...@@ -306,8 +306,22 @@ HRESULT WINAPI OleCreateFontIndirect( ...@@ -306,8 +306,22 @@ HRESULT WINAPI OleCreateFontIndirect(
*ppvObj = 0; *ppvObj = 0;
if (lpFontDesc == 0) if (!lpFontDesc) {
return NO_ERROR; /* MSDN Oct 2001 */ FONTDESC fd;
WCHAR fname[] = { 'S','y','s','t','e','m',0 };
fd.cbSizeofstruct = sizeof(fd);
fd.lpstrName = fname;
fd.cySize.s.Lo = 80000;
fd.cySize.s.Hi = 0;
fd.sWeight = 0;
fd.sCharset = 0;
fd.fItalic = 0;
fd.fUnderline = 0;
fd.fStrikethrough = 0;
lpFontDesc = &fd;
}
/* /*
* Try to construct a new instance of the class. * Try to construct a new instance of the class.
...@@ -1964,20 +1978,7 @@ static ULONG WINAPI SFCF_Release(LPCLASSFACTORY iface) { ...@@ -1964,20 +1978,7 @@ static ULONG WINAPI SFCF_Release(LPCLASSFACTORY iface) {
static HRESULT WINAPI SFCF_CreateInstance( static HRESULT WINAPI SFCF_CreateInstance(
LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj
) { ) {
FONTDESC fd; return OleCreateFontIndirect(NULL,riid,ppobj);
WCHAR fname[] = { 'S','y','s','t','e','m',0 };
fd.cbSizeofstruct = sizeof(fd);
fd.lpstrName = fname;
fd.cySize.s.Lo = 80000;
fd.cySize.s.Hi = 0;
fd.sWeight = 0;
fd.sCharset = 0;
fd.fItalic = 0;
fd.fUnderline = 0;
fd.fStrikethrough = 0;
return OleCreateFontIndirect(&fd,riid,ppobj);
} }
......
Makefile Makefile
oleaut32_test.exe.spec.c oleaut32_test.exe.spec.c
olefont.ok
safearray.ok safearray.ok
testlist.c testlist.c
vartest.ok vartest.ok
...@@ -7,6 +7,7 @@ IMPORTS = oleaut32 ...@@ -7,6 +7,7 @@ IMPORTS = oleaut32
EXTRALIBS = $(LIBUUID) EXTRALIBS = $(LIBUUID)
CTESTS = \ CTESTS = \
olefont.c \
safearray.c \ safearray.c \
vartest.c vartest.c
......
/*
* OLEFONT test program
*
* Copyright 2003 Marcus Meissner
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include <time.h>
#include <wine/test.h>
#include <winbase.h>
#include <winuser.h>
#include <wingdi.h>
#include <winnls.h>
#include <winerror.h>
#include <winnt.h>
#include <wtypes.h>
#include <olectl.h>
START_TEST(olefont)
{
LPVOID pvObj = NULL;
HRESULT hres;
IFont* font = NULL;
hres = OleCreateFontIndirect(NULL, &IID_IFont, &pvObj);
font = pvObj;
ok(hres == S_OK,"OCFI (NULL,..) does not return 0, but 0x%08lx",hres);
ok(font != NULL,"OCFI (NULL,..) does return NULL, insytead of !NULL");
pvObj = NULL;
hres = IFont_QueryInterface( font, &IID_IFont, &pvObj);
ok(hres == S_OK,"IFont_QI does not return S_OK, but 0x%08lx", hres);
ok(pvObj != NULL,"IFont_QI does return NULL, instead of a ptr");
}
...@@ -1539,6 +1539,7 @@ static HRESULT Coerce( VARIANTARG* pd, LCID lcid, ULONG dwFlags, VARIANTARG* ps, ...@@ -1539,6 +1539,7 @@ static HRESULT Coerce( VARIANTARG* pd, LCID lcid, ULONG dwFlags, VARIANTARG* ps,
case( VT_BOOL ): case( VT_BOOL ):
switch( vtFrom ) switch( vtFrom )
{ {
case( VT_NULL ):
case( VT_EMPTY ): case( VT_EMPTY ):
res = S_OK; res = S_OK;
V_UNION(pd,boolVal) = VARIANT_FALSE; V_UNION(pd,boolVal) = VARIANT_FALSE;
......
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