comctl32/syslink: Don't delete font when destroying the control.

The font set by WM_SETFONT is not owned by syslink so it shouldn't be deleted when handling
WM_DESTROY for the control.

Fix Toad for Oracle text gets reset to the system font after installing Team Coding. The application
creates a font and set it to a syslink. Then after the syslink destroys itself, the font becomes
invalid so other controls using the font end up falling back to the system font.
This commit is contained in:
Zhiyi Zhang 2024-01-01 18:04:44 +08:00 committed by Alexandre Julliard
parent daa6f9b1b2
commit 480598680c
2 changed files with 0 additions and 2 deletions

View file

@ -1711,7 +1711,6 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
case WM_DESTROY:
TRACE("SysLink Ctrl destruction, hwnd=%p\n", hwnd);
SYSLINK_ClearDoc(infoPtr);
if(infoPtr->Font != 0) DeleteObject(infoPtr->Font);
if(infoPtr->LinkFont != 0) DeleteObject(infoPtr->LinkFont);
SetWindowLongPtrW(hwnd, 0, 0);
Free (infoPtr);

View file

@ -1246,7 +1246,6 @@ static void test_WM_SETFONT(void)
}
else
{
todo_wine_if(!lstrcmpA(tests[i].class_name, "SysLink"))
ok(ret == sizeof(lf), "GetObjectA failed, error %lu.\n", GetLastError());
}