Ensure we free the cached HFONT after loading in a fresh font. Enables

fonts in VB programs to appear correctly.
This commit is contained in:
Jason Edmeades 2002-06-25 02:54:06 +00:00 committed by Alexandre Julliard
parent ac90ba9bce
commit 99b3307406

View File

@ -995,6 +995,7 @@ static HRESULT WINAPI OLEFontImpl_Clone(
GetProcessHeap(),0,
(1+strlenW(this->description.lpstrName))*2
);
strcpyW(newObject->description.lpstrName, this->description.lpstrName);
/* We need to clone the HFONT too. This is just cut & paste from above */
IFont_get_Size(iface, &cySize);
@ -1423,6 +1424,10 @@ static HRESULT WINAPI OLEFontImpl_Load(
MultiByteToWideChar( CP_ACP, 0, readBuffer, bStringSize, this->description.lpstrName, len );
this->description.lpstrName[len] = 0;
/* Ensure use of this font causes a new one to be created @@@@ */
DeleteObject(this->gdiFont);
this->gdiFont = 0;
return S_OK;
}