comctl32: Fix the loading of strings for the property sheet page by

caching the ID of the string to load before overwriting it with an
Alloc call.
This commit is contained in:
Robert Shearman 2006-05-23 16:53:55 +01:00 committed by Alexandre Julliard
parent e6b97ce2bd
commit f5660c23ae
1 changed files with 18 additions and 12 deletions

View File

@ -2907,9 +2907,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
PROPSHEET_AtoW( &ppsp->pszTitle, lpPropSheetPage->pszTitle ); PROPSHEET_AtoW( &ppsp->pszTitle, lpPropSheetPage->pszTitle );
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszTitle = Alloc( len ); ppsp->pszTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszTitle), (LPWSTR)ppsp->pszTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszTitle, len );
} }
} }
else else
@ -2924,9 +2925,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
PROPSHEET_AtoW(&ppsp->pszHeaderTitle, lpPropSheetPage->pszHeaderTitle); PROPSHEET_AtoW(&ppsp->pszHeaderTitle, lpPropSheetPage->pszHeaderTitle);
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszHeaderTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszHeaderTitle = Alloc( len ); ppsp->pszHeaderTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderTitle), (LPWSTR)ppsp->pszHeaderTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszHeaderTitle, len );
} }
} }
else else
@ -2938,9 +2940,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
PROPSHEET_AtoW(&ppsp->pszHeaderSubTitle, lpPropSheetPage->pszHeaderSubTitle); PROPSHEET_AtoW(&ppsp->pszHeaderSubTitle, lpPropSheetPage->pszHeaderSubTitle);
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderSubTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszHeaderSubTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszHeaderSubTitle = Alloc( len ); ppsp->pszHeaderSubTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderSubTitle), (LPWSTR)ppsp->pszHeaderSubTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszHeaderSubTitle, len );
} }
} }
else else
@ -2992,9 +2995,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
} }
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszTitle = Alloc( len ); ppsp->pszTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszTitle), (LPWSTR)ppsp->pszTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszTitle, len );
} }
} }
else else
@ -3013,9 +3017,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
} }
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszHeaderTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszHeaderTitle = Alloc( len ); ppsp->pszHeaderTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderTitle), (LPWSTR)ppsp->pszHeaderTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszHeaderTitle, len );
} }
} }
else else
@ -3031,9 +3036,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
} }
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderSubTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszHeaderSubTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszHeaderSubTitle = Alloc( len ); ppsp->pszHeaderSubTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderSubTitle), (LPWSTR)ppsp->pszHeaderSubTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszHeaderSubTitle, len );
} }
} }
else else