aboutsummaryrefslogtreecommitdiff
path: root/src/libs
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2022-08-29 18:02:37 -0400
committerBob Arnson <github@bobs.org>2022-08-29 20:12:15 -0400
commitf6c86c939af9f8b0036f4b197512f06e861e5fd3 (patch)
tree9d7827f4438de21fe6c48eefbbd2ab38e1605bb2 /src/libs
parenta5f672ec734df2bbc7559e5192f6c10d273215e1 (diff)
downloadwix-f6c86c939af9f8b0036f4b197512f06e861e5fd3.tar.gz
wix-f6c86c939af9f8b0036f4b197512f06e861e5fd3.tar.bz2
wix-f6c86c939af9f8b0036f4b197512f06e861e5fd3.zip
Restrict panels to static controls.
Fixes https://github.com/wixtoolset/issues/issues/6635.
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/thmutil.cpp109
1 files changed, 57 insertions, 52 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp
index c3dbe3e9..2341025c 100644
--- a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp
+++ b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp
@@ -45,6 +45,9 @@ const COLORREF THEME_INVISIBLE_COLORREF = 0xFFFFFFFF;
45const DWORD GROW_FONT_INSTANCES = 3; 45const DWORD GROW_FONT_INSTANCES = 3;
46const DWORD GROW_IMAGE_INSTANCES = 5; 46const DWORD GROW_IMAGE_INSTANCES = 5;
47 47
48const LPCWSTR ALL_CONTROL_NAMES = L"Billboard|Button|Checkbox|Combobox|CommandLink|Editbox|Hyperlink|Hypertext|ImageControl|Label|ListView|Panel|Progressbar|Richedit|Static|Tabs|TreeView";
49const LPCWSTR PANEL_CHILD_CONTROL_NAMES = L"Hyperlink|Hypertext|ImageControl|Label|Progressbar|Static";
50
48static Gdiplus::GdiplusStartupInput vgsi; 51static Gdiplus::GdiplusStartupInput vgsi;
49static Gdiplus::GdiplusStartupOutput vgso = { }; 52static Gdiplus::GdiplusStartupOutput vgso = { };
50static ULONG_PTR vgdiToken = 0; 53static ULONG_PTR vgdiToken = 0;
@@ -205,8 +208,9 @@ static HRESULT ParseControls(
205 __in IXMLDOMNode* pElement, 208 __in IXMLDOMNode* pElement,
206 __in THEME* pTheme, 209 __in THEME* pTheme,
207 __in_opt THEME_CONTROL* pParentControl, 210 __in_opt THEME_CONTROL* pParentControl,
208 __in_opt THEME_PAGE* pPage 211 __in_opt THEME_PAGE* pPage,
209 ); 212 __in_opt LPCWSTR wzControlNames
213);
210static HRESULT ParseControl( 214static HRESULT ParseControl(
211 __in_opt HMODULE hModule, 215 __in_opt HMODULE hModule,
212 __in_opt LPCWSTR wzRelativePath, 216 __in_opt LPCWSTR wzRelativePath,
@@ -2612,7 +2616,7 @@ static HRESULT ParseWindow(
2612 ThmExitOnFailure(hr, "Failed to parse theme pages."); 2616 ThmExitOnFailure(hr, "Failed to parse theme pages.");
2613 2617
2614 // Parse the non-paged controls. 2618 // Parse the non-paged controls.
2615 hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, NULL, NULL); 2619 hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, NULL, NULL, NULL);
2616 ThmExitOnFailure(hr, "Failed to parse theme controls."); 2620 ThmExitOnFailure(hr, "Failed to parse theme controls.");
2617 2621
2618LExit: 2622LExit:
@@ -2987,7 +2991,7 @@ static HRESULT ParsePages(
2987 hr = XmlGetAttributeEx(pixn, L"Name", &pPage->sczName); 2991 hr = XmlGetAttributeEx(pixn, L"Name", &pPage->sczName);
2988 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying page Name."); 2992 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying page Name.");
2989 2993
2990 hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, NULL, pPage); 2994 hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, NULL, pPage, NULL);
2991 ThmExitOnFailure(hr, "Failed to parse page controls."); 2995 ThmExitOnFailure(hr, "Failed to parse page controls.");
2992 2996
2993 ++iPage; 2997 ++iPage;
@@ -3171,7 +3175,8 @@ static HRESULT ParseControls(
3171 __in IXMLDOMNode* pElement, 3175 __in IXMLDOMNode* pElement,
3172 __in THEME* pTheme, 3176 __in THEME* pTheme,
3173 __in_opt THEME_CONTROL* pParentControl, 3177 __in_opt THEME_CONTROL* pParentControl,
3174 __in_opt THEME_PAGE* pPage 3178 __in_opt THEME_PAGE* pPage,
3179 __in_opt LPCWSTR wzControlNames
3175 ) 3180 )
3176{ 3181{
3177 HRESULT hr = S_OK; 3182 HRESULT hr = S_OK;
@@ -3188,7 +3193,7 @@ static HRESULT ParseControls(
3188 hr = ParseRadioButtons(hModule, wzRelativePath, pElement, pTheme, pParentControl, pPage); 3193 hr = ParseRadioButtons(hModule, wzRelativePath, pElement, pTheme, pParentControl, pPage);
3189 ThmExitOnFailure(hr, "Failed to parse radio buttons."); 3194 ThmExitOnFailure(hr, "Failed to parse radio buttons.");
3190 3195
3191 hr = XmlSelectNodes(pElement, L"Billboard|Button|Checkbox|Combobox|CommandLink|Editbox|Hyperlink|Hypertext|ImageControl|Label|ListView|Panel|Progressbar|Richedit|Static|Tabs|TreeView", &pixnl); 3196 hr = XmlSelectNodes(pElement, wzControlNames ? wzControlNames : ALL_CONTROL_NAMES, &pixnl);
3192 ThmExitOnFailure(hr, "Failed to find control elements."); 3197 ThmExitOnFailure(hr, "Failed to find control elements.");
3193 3198
3194 hr = pixnl->get_length(reinterpret_cast<long*>(&cNewControls)); 3199 hr = pixnl->get_length(reinterpret_cast<long*>(&cNewControls));
@@ -3353,28 +3358,28 @@ static HRESULT ParseControl(
3353 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control Name attribute."); 3358 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control Name attribute.");
3354 3359
3355 hr = XmlGetAttributeEx(pixn, L"EnableCondition", &pControl->sczEnableCondition); 3360 hr = XmlGetAttributeEx(pixn, L"EnableCondition", &pControl->sczEnableCondition);
3356 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control EnableCondition attribute."); 3361 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' EnableCondition attribute.", pControl->sczName);
3357 3362
3358 hr = XmlGetAttributeEx(pixn, L"VisibleCondition", &pControl->sczVisibleCondition); 3363 hr = XmlGetAttributeEx(pixn, L"VisibleCondition", &pControl->sczVisibleCondition);
3359 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control VisibleCondition attribute."); 3364 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' VisibleCondition attribute.", pControl->sczName);
3360 3365
3361 hr = GetAttributeCoordinateOrDimension(pixn, L"X", &nValue); 3366 hr = GetAttributeCoordinateOrDimension(pixn, L"X", &nValue);
3362 ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control X attribute."); 3367 ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control '%ls' X attribute.", pControl->sczName);
3363 3368
3364 pControl->nX = pControl->nDefaultDpiX = nValue; 3369 pControl->nX = pControl->nDefaultDpiX = nValue;
3365 3370
3366 hr = GetAttributeCoordinateOrDimension(pixn, L"Y", &nValue); 3371 hr = GetAttributeCoordinateOrDimension(pixn, L"Y", &nValue);
3367 ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control Y attribute."); 3372 ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control '%ls' Y attribute.", pControl->sczName);
3368 3373
3369 pControl->nY = pControl->nDefaultDpiY = nValue; 3374 pControl->nY = pControl->nDefaultDpiY = nValue;
3370 3375
3371 hr = GetAttributeCoordinateOrDimension(pixn, L"Height", &nValue); 3376 hr = GetAttributeCoordinateOrDimension(pixn, L"Height", &nValue);
3372 ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control Height attribute."); 3377 ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control '%ls' Height attribute.", pControl->sczName);
3373 3378
3374 pControl->nHeight = pControl->nDefaultDpiHeight = nValue; 3379 pControl->nHeight = pControl->nDefaultDpiHeight = nValue;
3375 3380
3376 hr = GetAttributeCoordinateOrDimension(pixn, L"Width", &nValue); 3381 hr = GetAttributeCoordinateOrDimension(pixn, L"Width", &nValue);
3377 ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control Width attribute."); 3382 ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control '%ls' Width attribute.", pControl->sczName);
3378 3383
3379 pControl->nWidth = pControl->nDefaultDpiWidth = nValue; 3384 pControl->nWidth = pControl->nDefaultDpiWidth = nValue;
3380 3385
@@ -3382,19 +3387,19 @@ static HRESULT ParseControl(
3382 { 3387 {
3383 case THEME_CONTROL_TYPE_COMMANDLINK: 3388 case THEME_CONTROL_TYPE_COMMANDLINK:
3384 hr = ParseCommandLinkImage(hModule, wzRelativePath, pixn, pControl); 3389 hr = ParseCommandLinkImage(hModule, wzRelativePath, pixn, pControl);
3385 ThmExitOnFailure(hr, "Failed while parsing CommandLink image."); 3390 ThmExitOnFailure(hr, "Failed while parsing CommandLink '%ls' image.", pControl->sczName);
3386 break; 3391 break;
3387 case THEME_CONTROL_TYPE_BUTTON: 3392 case THEME_CONTROL_TYPE_BUTTON:
3388 hr = ParseButtonImages(hModule, wzRelativePath, pTheme, pixn, pControl); 3393 hr = ParseButtonImages(hModule, wzRelativePath, pTheme, pixn, pControl);
3389 ThmExitOnFailure(hr, "Failed while parsing Button images."); 3394 ThmExitOnFailure(hr, "Failed while parsing Button '%ls' images.", pControl->sczName);
3390 break; 3395 break;
3391 case THEME_CONTROL_TYPE_IMAGE: 3396 case THEME_CONTROL_TYPE_IMAGE:
3392 hr = ParseOwnerDrawImage(hModule, wzRelativePath, pTheme, pixn, wzElementName, pControl, &pControl->Image.imageRef); 3397 hr = ParseOwnerDrawImage(hModule, wzRelativePath, pTheme, pixn, wzElementName, pControl, &pControl->Image.imageRef);
3393 ThmExitOnFailure(hr, "Failed while parsing ImageControl image."); 3398 ThmExitOnFailure(hr, "Failed while parsing ImageControl '%ls' image.", pControl->sczName);
3394 break; 3399 break;
3395 case THEME_CONTROL_TYPE_PROGRESSBAR: 3400 case THEME_CONTROL_TYPE_PROGRESSBAR:
3396 hr = ParseProgressBarImages(hModule, wzRelativePath, pTheme, pixn, pControl); 3401 hr = ParseProgressBarImages(hModule, wzRelativePath, pTheme, pixn, pControl);
3397 ThmExitOnFailure(hr, "Failed while parsing Progressbar images."); 3402 ThmExitOnFailure(hr, "Failed while parsing Progressbar '%ls' images.", pControl->sczName);
3398 break; 3403 break;
3399 default: 3404 default:
3400 ThmExitOnUnexpectedAttribute(hr, pixn, wzElementName, L"ImageId"); 3405 ThmExitOnUnexpectedAttribute(hr, pixn, wzElementName, L"ImageId");
@@ -3407,15 +3412,15 @@ static HRESULT ParseControl(
3407 3412
3408 3413
3409 hr = GetAttributeFontId(pTheme, pixn, L"FontId", &pControl->dwFontId); 3414 hr = GetAttributeFontId(pTheme, pixn, L"FontId", &pControl->dwFontId);
3410 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control FontId attribute."); 3415 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' FontId attribute.", pControl->sczName);
3411 3416
3412 // Parse the optional window style. 3417 // Parse the optional window style.
3413 hr = XmlGetAttributeNumberBase(pixn, L"HexStyle", 16, &pControl->dwStyle); 3418 hr = XmlGetAttributeNumberBase(pixn, L"HexStyle", 16, &pControl->dwStyle);
3414 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control HexStyle attribute."); 3419 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' HexStyle attribute.", pControl->sczName);
3415 3420
3416 // Parse the tabstop bit "shortcut nomenclature", this could have been set with the style above. 3421 // Parse the tabstop bit "shortcut nomenclature", this could have been set with the style above.
3417 hr = XmlGetYesNoAttribute(pixn, L"TabStop", &fValue); 3422 hr = XmlGetYesNoAttribute(pixn, L"TabStop", &fValue);
3418 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control TabStop attribute."); 3423 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' TabStop attribute.", pControl->sczName);
3419 3424
3420 if (fXmlFound && fValue) 3425 if (fXmlFound && fValue)
3421 { 3426 {
@@ -3423,7 +3428,7 @@ static HRESULT ParseControl(
3423 } 3428 }
3424 3429
3425 hr = XmlGetYesNoAttribute(pixn, L"Visible", &fValue); 3430 hr = XmlGetYesNoAttribute(pixn, L"Visible", &fValue);
3426 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control Visible attribute."); 3431 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' Visible attribute.", pControl->sczName);
3427 3432
3428 if (fXmlFound && fValue) 3433 if (fXmlFound && fValue)
3429 { 3434 {
@@ -3431,7 +3436,7 @@ static HRESULT ParseControl(
3431 } 3436 }
3432 3437
3433 hr = XmlGetYesNoAttribute(pixn, L"HideWhenDisabled", &fValue); 3438 hr = XmlGetYesNoAttribute(pixn, L"HideWhenDisabled", &fValue);
3434 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control HideWhenDisabled attribute."); 3439 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' HideWhenDisabled attribute.", pControl->sczName);
3435 3440
3436 if (fXmlFound && fValue) 3441 if (fXmlFound && fValue)
3437 { 3442 {
@@ -3439,24 +3444,24 @@ static HRESULT ParseControl(
3439 } 3444 }
3440 3445
3441 hr = ParseActions(pixn, pControl); 3446 hr = ParseActions(pixn, pControl);
3442 ThmExitOnFailure(hr, "Failed to parse action nodes of the control."); 3447 ThmExitOnFailure(hr, "Failed to parse action nodes of the control '%ls'.", pControl->sczName);
3443 3448
3444 hr = ParseText(pixn, pControl, &fAnyTextChildren); 3449 hr = ParseText(pixn, pControl, &fAnyTextChildren);
3445 ThmExitOnFailure(hr, "Failed to parse text nodes of the control."); 3450 ThmExitOnFailure(hr, "Failed to parse text nodes of the control '%ls'.", pControl->sczName);
3446 3451
3447 hr = ParseTooltips(pixn, pControl, &fAnyTextChildren); 3452 hr = ParseTooltips(pixn, pControl, &fAnyTextChildren);
3448 ThmExitOnFailure(hr, "Failed to parse control Tooltip."); 3453 ThmExitOnFailure(hr, "Failed to parse control '%ls' Tooltip.", pControl->sczName);
3449 3454
3450 if (THEME_CONTROL_TYPE_COMMANDLINK == pControl->type) 3455 if (THEME_CONTROL_TYPE_COMMANDLINK == pControl->type)
3451 { 3456 {
3452 hr = ParseNotes(pixn, pControl, &fAnyNoteChildren); 3457 hr = ParseNotes(pixn, pControl, &fAnyNoteChildren);
3453 ThmExitOnFailure(hr, "Failed to parse note text nodes of the control."); 3458 ThmExitOnFailure(hr, "Failed to parse note text nodes of the control '%ls'.", pControl->sczName);
3454 } 3459 }
3455 3460
3456 if (!fAnyTextChildren && !fAnyNoteChildren) 3461 if (!fAnyTextChildren && !fAnyNoteChildren)
3457 { 3462 {
3458 hr = XmlGetAttributeUInt32(pixn, L"StringId", &dwValue); 3463 hr = XmlGetAttributeUInt32(pixn, L"StringId", &dwValue);
3459 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control StringId attribute."); 3464 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' StringId attribute.", pControl->sczName);
3460 3465
3461 if (fXmlFound) 3466 if (fXmlFound)
3462 { 3467 {
@@ -3468,7 +3473,7 @@ static HRESULT ParseControl(
3468 if (THEME_CONTROL_TYPE_BILLBOARD != pControl->type && THEME_CONTROL_TYPE_PANEL != pControl->type) 3473 if (THEME_CONTROL_TYPE_BILLBOARD != pControl->type && THEME_CONTROL_TYPE_PANEL != pControl->type)
3469 { 3474 {
3470 hr = XmlGetText(pixn, &bstrText); 3475 hr = XmlGetText(pixn, &bstrText);
3471 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get control inner text."); 3476 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get control '%ls' inner text.", pControl->sczName);
3472 3477
3473 if (fXmlFound) 3478 if (fXmlFound)
3474 { 3479 {
@@ -3484,10 +3489,10 @@ static HRESULT ParseControl(
3484 if (THEME_CONTROL_TYPE_BILLBOARD == pControl->type) 3489 if (THEME_CONTROL_TYPE_BILLBOARD == pControl->type)
3485 { 3490 {
3486 hr = XmlGetYesNoAttribute(pixn, L"Loop", &pControl->fBillboardLoops); 3491 hr = XmlGetYesNoAttribute(pixn, L"Loop", &pControl->fBillboardLoops);
3487 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying Billboard/@Loop attribute."); 3492 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' Billboard/@Loop attribute.", pControl->sczName);
3488 3493
3489 hr = XmlGetAttributeUInt16(pixn, L"Interval", &pControl->wBillboardInterval); 3494 hr = XmlGetAttributeUInt16(pixn, L"Interval", &pControl->wBillboardInterval);
3490 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying Billboard/@Interval attribute."); 3495 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' Billboard/@Interval attribute.", pControl->sczName);
3491 3496
3492 if (!pControl->wBillboardInterval) 3497 if (!pControl->wBillboardInterval)
3493 { 3498 {
@@ -3495,12 +3500,12 @@ static HRESULT ParseControl(
3495 } 3500 }
3496 3501
3497 hr = ParseBillboardPanels(hModule, wzRelativePath, pixn, pTheme, pControl, pPage); 3502 hr = ParseBillboardPanels(hModule, wzRelativePath, pixn, pTheme, pControl, pPage);
3498 ThmExitOnFailure(hr, "Failed to parse billboard children."); 3503 ThmExitOnFailure(hr, "Failed to parse billboard '%ls' children.", pControl->sczName);
3499 } 3504 }
3500 else if (THEME_CONTROL_TYPE_EDITBOX == pControl->type) 3505 else if (THEME_CONTROL_TYPE_EDITBOX == pControl->type)
3501 { 3506 {
3502 hr = XmlGetYesNoAttribute(pixn, L"FileSystemAutoComplete", &fValue); 3507 hr = XmlGetYesNoAttribute(pixn, L"FileSystemAutoComplete", &fValue);
3503 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying Editbox/@FileSystemAutoComplete attribute."); 3508 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' Editbox/@FileSystemAutoComplete attribute.", pControl->sczName);
3504 3509
3505 if (fXmlFound && fValue) 3510 if (fXmlFound && fValue)
3506 { 3511 {
@@ -3510,15 +3515,15 @@ static HRESULT ParseControl(
3510 else if (THEME_CONTROL_TYPE_HYPERLINK == pControl->type || THEME_CONTROL_TYPE_BUTTON == pControl->type) 3515 else if (THEME_CONTROL_TYPE_HYPERLINK == pControl->type || THEME_CONTROL_TYPE_BUTTON == pControl->type)
3511 { 3516 {
3512 hr = GetAttributeFontId(pTheme, pixn, L"HoverFontId", &pControl->dwFontHoverId); 3517 hr = GetAttributeFontId(pTheme, pixn, L"HoverFontId", &pControl->dwFontHoverId);
3513 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control HoverFontId attribute."); 3518 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' HoverFontId attribute.", pControl->sczName);
3514 3519
3515 hr = GetAttributeFontId(pTheme, pixn, L"SelectedFontId", &pControl->dwFontSelectedId); 3520 hr = GetAttributeFontId(pTheme, pixn, L"SelectedFontId", &pControl->dwFontSelectedId);
3516 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control SelectedFontId attribute."); 3521 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' SelectedFontId attribute.", pControl->sczName);
3517 } 3522 }
3518 else if (THEME_CONTROL_TYPE_LABEL == pControl->type) 3523 else if (THEME_CONTROL_TYPE_LABEL == pControl->type)
3519 { 3524 {
3520 hr = XmlGetYesNoAttribute(pixn, L"Center", &fValue); 3525 hr = XmlGetYesNoAttribute(pixn, L"Center", &fValue);
3521 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying Label/@Center attribute."); 3526 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' Label/@Center attribute.", pControl->sczName);
3522 3527
3523 if (fXmlFound && fValue) 3528 if (fXmlFound && fValue)
3524 { 3529 {
@@ -3526,7 +3531,7 @@ static HRESULT ParseControl(
3526 } 3531 }
3527 3532
3528 hr = XmlGetYesNoAttribute(pixn, L"DisablePrefix", &fValue); 3533 hr = XmlGetYesNoAttribute(pixn, L"DisablePrefix", &fValue);
3529 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying Label/@DisablePrefix attribute."); 3534 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' Label/@DisablePrefix attribute.", pControl->sczName);
3530 3535
3531 if (fXmlFound && fValue) 3536 if (fXmlFound && fValue)
3532 { 3537 {
@@ -3537,10 +3542,10 @@ static HRESULT ParseControl(
3537 { 3542 {
3538 // Parse the optional extended window style. 3543 // Parse the optional extended window style.
3539 hr = XmlGetAttributeNumberBase(pixn, L"HexExtendedStyle", 16, &pControl->dwExtendedStyle); 3544 hr = XmlGetAttributeNumberBase(pixn, L"HexExtendedStyle", 16, &pControl->dwExtendedStyle);
3540 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying ListView/@HexExtendedStyle attribute."); 3545 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' ListView/@HexExtendedStyle attribute.", pControl->sczName);
3541 3546
3542 hr = XmlGetAttribute(pixn, L"ImageList", &bstrText); 3547 hr = XmlGetAttribute(pixn, L"ImageList", &bstrText);
3543 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying ListView/@ImageList attribute."); 3548 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' ListView/@ImageList attribute.", pControl->sczName);
3544 3549
3545 if (fXmlFound) 3550 if (fXmlFound)
3546 { 3551 {
@@ -3549,7 +3554,7 @@ static HRESULT ParseControl(
3549 } 3554 }
3550 3555
3551 hr = XmlGetAttribute(pixn, L"ImageListSmall", &bstrText); 3556 hr = XmlGetAttribute(pixn, L"ImageListSmall", &bstrText);
3552 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying ListView/@ImageListSmall attribute."); 3557 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' ListView/@ImageListSmall attribute.", pControl->sczName);
3553 3558
3554 if (fXmlFound) 3559 if (fXmlFound)
3555 { 3560 {
@@ -3558,7 +3563,7 @@ static HRESULT ParseControl(
3558 } 3563 }
3559 3564
3560 hr = XmlGetAttribute(pixn, L"ImageListState", &bstrText); 3565 hr = XmlGetAttribute(pixn, L"ImageListState", &bstrText);
3561 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying ListView/@ImageListState attribute."); 3566 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' ListView/@ImageListState attribute.", pControl->sczName);
3562 3567
3563 if (fXmlFound) 3568 if (fXmlFound)
3564 { 3569 {
@@ -3567,7 +3572,7 @@ static HRESULT ParseControl(
3567 } 3572 }
3568 3573
3569 hr = XmlGetAttribute(pixn, L"ImageListGroupHeader", &bstrText); 3574 hr = XmlGetAttribute(pixn, L"ImageListGroupHeader", &bstrText);
3570 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying ListView/@ImageListGroupHeader attribute."); 3575 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' ListView/@ImageListGroupHeader attribute.", pControl->sczName);
3571 3576
3572 if (fXmlFound) 3577 if (fXmlFound)
3573 { 3578 {
@@ -3580,13 +3585,13 @@ static HRESULT ParseControl(
3580 } 3585 }
3581 else if (THEME_CONTROL_TYPE_PANEL == pControl->type) 3586 else if (THEME_CONTROL_TYPE_PANEL == pControl->type)
3582 { 3587 {
3583 hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, pControl, pPage); 3588 hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, pControl, pPage, PANEL_CHILD_CONTROL_NAMES);
3584 ThmExitOnFailure(hr, "Failed to parse panel children."); 3589 ThmExitOnFailure(hr, "Failed to parse panel children.");
3585 } 3590 }
3586 else if (THEME_CONTROL_TYPE_RADIOBUTTON == pControl->type) 3591 else if (THEME_CONTROL_TYPE_RADIOBUTTON == pControl->type)
3587 { 3592 {
3588 hr = XmlGetAttributeEx(pixn, L"Value", &pControl->sczValue); 3593 hr = XmlGetAttributeEx(pixn, L"Value", &pControl->sczValue);
3589 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying RadioButton/@Value attribute."); 3594 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' RadioButton/@Value attribute.", pControl->sczName);
3590 } 3595 }
3591 else if (THEME_CONTROL_TYPE_TAB == pControl->type) 3596 else if (THEME_CONTROL_TYPE_TAB == pControl->type)
3592 { 3597 {
@@ -3598,7 +3603,7 @@ static HRESULT ParseControl(
3598 pControl->dwStyle |= TVS_DISABLEDRAGDROP; 3603 pControl->dwStyle |= TVS_DISABLEDRAGDROP;
3599 3604
3600 hr = XmlGetYesNoAttribute(pixn, L"EnableDragDrop", &fValue); 3605 hr = XmlGetYesNoAttribute(pixn, L"EnableDragDrop", &fValue);
3601 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@EnableDragDrop attribute."); 3606 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@EnableDragDrop attribute.", pControl->sczName);
3602 3607
3603 if (fXmlFound && fValue) 3608 if (fXmlFound && fValue)
3604 { 3609 {
@@ -3606,7 +3611,7 @@ static HRESULT ParseControl(
3606 } 3611 }
3607 3612
3608 hr = XmlGetYesNoAttribute(pixn, L"FullRowSelect", &fValue); 3613 hr = XmlGetYesNoAttribute(pixn, L"FullRowSelect", &fValue);
3609 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@FullRowSelect attribute."); 3614 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@FullRowSelect attribute.", pControl->sczName);
3610 3615
3611 if (fXmlFound && fValue) 3616 if (fXmlFound && fValue)
3612 { 3617 {
@@ -3614,7 +3619,7 @@ static HRESULT ParseControl(
3614 } 3619 }
3615 3620
3616 hr = XmlGetYesNoAttribute(pixn, L"HasButtons", &fValue); 3621 hr = XmlGetYesNoAttribute(pixn, L"HasButtons", &fValue);
3617 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@HasButtons attribute."); 3622 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@HasButtons attribute.", pControl->sczName);
3618 3623
3619 if (fXmlFound && fValue) 3624 if (fXmlFound && fValue)
3620 { 3625 {
@@ -3622,7 +3627,7 @@ static HRESULT ParseControl(
3622 } 3627 }
3623 3628
3624 hr = XmlGetYesNoAttribute(pixn, L"AlwaysShowSelect", &fValue); 3629 hr = XmlGetYesNoAttribute(pixn, L"AlwaysShowSelect", &fValue);
3625 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@AlwaysShowSelect attribute."); 3630 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@AlwaysShowSelect attribute.", pControl->sczName);
3626 3631
3627 if (fXmlFound && fValue) 3632 if (fXmlFound && fValue)
3628 { 3633 {
@@ -3630,7 +3635,7 @@ static HRESULT ParseControl(
3630 } 3635 }
3631 3636
3632 hr = XmlGetYesNoAttribute(pixn, L"LinesAtRoot", &fValue); 3637 hr = XmlGetYesNoAttribute(pixn, L"LinesAtRoot", &fValue);
3633 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@LinesAtRoot attribute."); 3638 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@LinesAtRoot attribute.", pControl->sczName);
3634 3639
3635 if (fXmlFound && fValue) 3640 if (fXmlFound && fValue)
3636 { 3641 {
@@ -3638,7 +3643,7 @@ static HRESULT ParseControl(
3638 } 3643 }
3639 3644
3640 hr = XmlGetYesNoAttribute(pixn, L"HasLines", &fValue); 3645 hr = XmlGetYesNoAttribute(pixn, L"HasLines", &fValue);
3641 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@HasLines attribute."); 3646 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@HasLines attribute.", pControl->sczName);
3642 3647
3643 if (fXmlFound && fValue) 3648 if (fXmlFound && fValue)
3644 { 3649 {
@@ -3775,15 +3780,15 @@ static HRESULT ParseBillboardPanels(
3775 DWORD dwValue = 0; 3780 DWORD dwValue = 0;
3776 THEME_CONTROL* pControl = NULL; 3781 THEME_CONTROL* pControl = NULL;
3777 3782
3778 hr = XmlSelectNodes(pElement, L"BillboardPanel", &pixnl); 3783 hr = XmlSelectNodes(pElement, L"Panel", &pixnl);
3779 ThmExitOnFailure(hr, "Failed to select child billboard panel nodes."); 3784 ThmExitOnFailure(hr, "Failed to select billboard child nodes.");
3780 3785
3781 hr = pixnl->get_length(reinterpret_cast<long*>(&dwValue)); 3786 hr = pixnl->get_length(reinterpret_cast<long*>(&dwValue));
3782 ThmExitOnFailure(hr, "Failed to count the number of billboard panel nodes."); 3787 ThmExitOnFailure(hr, "Failed to count the number of billboard panel nodes.");
3783 3788
3784 if (!dwValue) 3789 if (!dwValue)
3785 { 3790 {
3786 ThmExitWithRootFailure(hr, E_INVALIDDATA, "Billboard must have at least one BillboardPanel."); 3791 ThmExitWithRootFailure(hr, E_INVALIDDATA, "Billboard must have at least one Panel.");
3787 } 3792 }
3788 3793
3789 hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(&pParentControl->rgControls), pParentControl->cControls, dwValue, sizeof(THEME_CONTROL), 0); 3794 hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(&pParentControl->rgControls), pParentControl->cControls, dwValue, sizeof(THEME_CONTROL), 0);
@@ -3801,7 +3806,7 @@ static HRESULT ParseBillboardPanels(
3801 pControl->wPageId = pPage->wId; 3806 pControl->wPageId = pPage->wId;
3802 } 3807 }
3803 3808
3804 hr = ParseControls(hModule, wzRelativePath, pixnChild, pTheme, pControl, pPage); 3809 hr = ParseControls(hModule, wzRelativePath, pixnChild, pTheme, pControl, pPage, PANEL_CHILD_CONTROL_NAMES);
3805 ThmExitOnFailure(hr, "Failed to parse control."); 3810 ThmExitOnFailure(hr, "Failed to parse control.");
3806 3811
3807 ReleaseNullObject(pixnChild); 3812 ReleaseNullObject(pixnChild);