From c14ff4bef0bd87000fea08eb69d29ddc6d874f5f Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Tue, 18 Jun 2013 16:34:27 +0900 Subject: [PATCH] comctl32: Fix broken logic for retrieving default font properties. --- dlls/comctl32/tab.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index bd75c888b59..85467ba8130 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -1899,7 +1899,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect if(infoPtr->dwStyle & TCS_VERTICAL) /* if we are vertical rotate the text and each character */ { LOGFONTW logfont; - HFONT hFont = 0; + HFONT hFont; INT nEscapement = 900; INT nOrientation = 900; @@ -1911,10 +1911,8 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect /* to get a font with the escapement and orientation we are looking for, we need to */ /* call CreateFontIndirect, which requires us to set the values of the logfont we pass in */ - if (!GetObjectW((infoPtr->hFont) ? - infoPtr->hFont : GetStockObject(DEFAULT_GUI_FONT), - sizeof(LOGFONTW),&logfont)) - GetStockObject(DEFAULT_GUI_FONT); + if (!GetObjectW(infoPtr->hFont, sizeof(logfont), &logfont)) + GetObjectW(GetStockObject(DEFAULT_GUI_FONT), sizeof(logfont), &logfont); logfont.lfEscapement = nEscapement; logfont.lfOrientation = nOrientation;