From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54927 --- dlls/uxtheme/draw.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/dlls/uxtheme/draw.c b/dlls/uxtheme/draw.c index eec73d67d07..f69fcc49f0c 100644 --- a/dlls/uxtheme/draw.c +++ b/dlls/uxtheme/draw.c @@ -1782,7 +1782,7 @@ HRESULT WINAPI DrawThemeTextEx(HTHEME hTheme, HDC hdc, int iPartId, int iStateId COLORREF textColor; COLORREF oldTextColor; int oldBkMode; - int fontProp; + int fontProp = TMT_GLYPHFONT;
TRACE("%p %p %d %d %s:%d 0x%08lx %p %p\n", hTheme, hdc, iPartId, iStateId, debugstr_wn(pszText, iCharCount), iCharCount, flags, rect, options); @@ -1790,13 +1790,19 @@ HRESULT WINAPI DrawThemeTextEx(HTHEME hTheme, HDC hdc, int iPartId, int iStateId if(!hTheme) return E_HANDLE;
- if (options->dwFlags & ~(DTT_TEXTCOLOR | DTT_FONTPROP)) - FIXME("unsupported flags 0x%08lx\n", options->dwFlags); + if(options) { + if(options->dwFlags & ~(DTT_TEXTCOLOR | DTT_FONTPROP)) + FIXME("unsupported flags 0x%08lx\n", options->dwFlags); + if(options->dwFlags & DTT_FONTPROP) + fontProp = options->iFontPropId; + if(options->dwFlags & DTT_TEXTCOLOR) + textColor = options->crText; + }
- if (options->dwFlags & DTT_FONTPROP) - fontProp = options->iFontPropId; - else - fontProp = TMT_FONT; + if(!options || !(options->dwFlags & DTT_TEXTCOLOR)) { + if(FAILED(GetThemeColor(hTheme, iPartId, iStateId, TMT_TEXTCOLOR, &textColor))) + textColor = GetTextColor(hdc); + }
hr = GetThemeFont(hTheme, hdc, iPartId, iStateId, fontProp, &logfont); if(SUCCEEDED(hr)) { @@ -1808,12 +1814,6 @@ HRESULT WINAPI DrawThemeTextEx(HTHEME hTheme, HDC hdc, int iPartId, int iStateId if(hFont) oldFont = SelectObject(hdc, hFont);
- if (options->dwFlags & DTT_TEXTCOLOR) - textColor = options->crText; - else { - if(FAILED(GetThemeColor(hTheme, iPartId, iStateId, TMT_TEXTCOLOR, &textColor))) - textColor = GetTextColor(hdc); - } oldTextColor = SetTextColor(hdc, textColor); oldBkMode = SetBkMode(hdc, TRANSPARENT); DrawTextW(hdc, pszText, iCharCount, rect, flags);