Commit dfffe7b4 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

uxtheme: If the application class is already set then OpenThemeData() should fail.

parent 87f1a380
...@@ -1076,8 +1076,11 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList, U ...@@ -1076,8 +1076,11 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList, U
parse_app_class_name(buf, szAppName, szClassName); parse_app_class_name(buf, szAppName, szClassName);
if (szAppName[0]) if (szAppName[0])
cls = MSSTYLES_FindClass(tfActiveTheme, szAppName, szClassName); {
else /* If the application class is already set then fail */
if (pszAppName) return NULL;
pszAppName = szAppName;
}
cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName); cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName);
/* Fall back to default class if the specified subclass is not found */ /* Fall back to default class if the specified subclass is not found */
...@@ -1088,8 +1091,11 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList, U ...@@ -1088,8 +1091,11 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList, U
if(!cls && *start) { if(!cls && *start) {
parse_app_class_name(start, szAppName, szClassName); parse_app_class_name(start, szAppName, szClassName);
if (szAppName[0]) if (szAppName[0])
cls = MSSTYLES_FindClass(tfActiveTheme, szAppName, szClassName); {
else /* If the application class is already set then fail */
if (pszAppName) return NULL;
pszAppName = szAppName;
}
cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName); cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName);
/* Fall back to default class if the specified subclass is not found */ /* Fall back to default class if the specified subclass is not found */
......
...@@ -562,9 +562,7 @@ static void test_OpenThemeData(void) ...@@ -562,9 +562,7 @@ static void test_OpenThemeData(void)
ok(hRes == S_OK, "Got unexpected hr %#lx.\n", hRes); ok(hRes == S_OK, "Got unexpected hr %#lx.\n", hRes);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hTheme = OpenThemeData(hWnd, L"explorer::treeview"); hTheme = OpenThemeData(hWnd, L"explorer::treeview");
todo_wine
ok(!hTheme, "OpenThemeData() should fail\n"); ok(!hTheme, "OpenThemeData() should fail\n");
todo_wine
ok(GetLastError() == E_PROP_ID_UNSUPPORTED, "Got unexpected %#lx.\n", GetLastError()); ok(GetLastError() == E_PROP_ID_UNSUPPORTED, "Got unexpected %#lx.\n", GetLastError());
SetWindowTheme(hWnd, NULL, NULL); SetWindowTheme(hWnd, NULL, NULL);
......
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