Module: wine Branch: master Commit: eb8eccbed424d2c0bb60543fcf3dea603e2741e2 URL: https://gitlab.winehq.org/wine/wine/-/commit/eb8eccbed424d2c0bb60543fcf3dea6...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Thu Nov 9 20:54:04 2023 +0800
uxtheme: Fix a test failure.
pszAppName should not be changed as it's used in the loop to check if window application name is set.
---
dlls/uxtheme/msstyles.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index 4fc9a344661..76d2f760b58 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c @@ -1075,14 +1075,12 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList, U start = end+1;
parse_app_class_name(buf, szAppName, szClassName); - if (szAppName[0]) - { - /* If the application class is already set then fail */ - if (pszAppName) return NULL; - pszAppName = szAppName; - } - cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName);
+ /* If the window application name is set then fail */ + if (szAppName[0] && pszAppName) + return NULL; + + cls = MSSTYLES_FindClass(tfActiveTheme, szAppName[0] ? szAppName : pszAppName, szClassName); /* Fall back to default class if the specified subclass is not found */ if (!cls) cls = MSSTYLES_FindClass(tfActiveTheme, NULL, szClassName);
@@ -1090,14 +1088,12 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList, U } if(!cls && *start) { parse_app_class_name(start, szAppName, szClassName); - if (szAppName[0]) - { - /* If the application class is already set then fail */ - if (pszAppName) return NULL; - pszAppName = szAppName; - } - cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName);
+ /* If the window application name is set then fail */ + if (szAppName[0] && pszAppName) + return NULL; + + cls = MSSTYLES_FindClass(tfActiveTheme, szAppName[0] ? szAppName : pszAppName, szClassName); /* Fall back to default class if the specified subclass is not found */ if (!cls) cls = MSSTYLES_FindClass(tfActiveTheme, NULL, szClassName); }