Commit 87f1a380 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

uxtheme: Move fall back to default class to MSSTYLES_OpenThemeClass().

parent 992d197d
......@@ -1079,6 +1079,10 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList, U
cls = MSSTYLES_FindClass(tfActiveTheme, szAppName, szClassName);
else
cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName);
/* Fall back to default class if the specified subclass is not found */
if (!cls) cls = MSSTYLES_FindClass(tfActiveTheme, NULL, szClassName);
if(cls) break;
}
if(!cls && *start) {
......@@ -1087,6 +1091,9 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList, U
cls = MSSTYLES_FindClass(tfActiveTheme, szAppName, szClassName);
else
cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName);
/* Fall back to default class if the specified subclass is not found */
if (!cls) cls = MSSTYLES_FindClass(tfActiveTheme, NULL, szClassName);
}
if(cls) {
TRACE("Opened app %s, class %s from list %s\n", debugstr_w(cls->szAppName), debugstr_w(cls->szClassName), debugstr_w(pszClassList));
......
......@@ -641,10 +641,6 @@ static HTHEME open_theme_data(HWND hwnd, LPCWSTR pszClassList, DWORD flags, UINT
if (pszUseClassList)
hTheme = MSSTYLES_OpenThemeClass(pszAppName, pszUseClassList, dpi);
/* Fall back to default class if the specified subclass is not found */
if (!hTheme)
hTheme = MSSTYLES_OpenThemeClass(NULL, pszUseClassList, dpi);
}
if(IsWindow(hwnd))
SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme), hTheme);
......
......@@ -583,9 +583,7 @@ static void test_OpenThemeData(void)
SetLastError(0xdeadbeef);
hTheme = OpenThemeData(hWnd, L"deadbeef::treeview;dead::beef");
todo_wine
ok(hTheme != NULL, "OpenThemeData() failed\n");
todo_wine
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got 0x%08lx\n", GetLastError());
CloseThemeData(hTheme);
......
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