Convert only well-known WixUI ids.
Fixes https://github.com/wixtoolset/issues/issues/6958.
Bob Arnson committed
Nov 7, 2022 at 21:15 UTC
55d1af260bc383dab269fbf0f371c2b1d84a3fed
2 files changed
+5
-4
src/wix/WixToolset.Converters/WixConverter.cs
+2
-1
@@ -1540,7 +1540,8 @@ namespace WixToolset.Converters
1540
{
1541
var id = element.Attribute("Id")?.Value;
1542
1543
- if (id?.StartsWith("WixUI_") == true
1543
+ if (id != null
1544
+ && (id == "WixUI_Advanced" || id == "WixUI_FeatureTree" || id == "WixUI_InstallDir" || id == "WixUI_Minimal" || id == "WixUI_Mondo")
1545
&& this.OnInformation(ConverterTestType.ReferencesReplaced, element, "UI, custom action, and property reference {0} has been replaced with strongly-typed element.", id))
1546
{
1547
this.XRoot.SetAttributeValue(XNamespace.Xmlns + "ui", WixUiNamespace.NamespaceName);
src/wix/test/WixToolsetTest.Converters/UIExtensionFixture.cs
+3
-3
@@ -34,11 +34,11 @@ namespace WixToolsetTest.Converters
34
" <Fragment>",
35
" <ui:WixUI Id=\"WixUI_Advanced\" />",
36
" <ui:WixUI Id=\"WixUI_FeatureTree\" />",
37
- " <ui:WixUI Id=\"WixUI_BobsSpecialUI\" />",
37
+ " <UIRef Id=\"WixUI_BobsSpecialUI\" />",
38
" <UI>",
39
" <ui:WixUI Id=\"WixUI_Advanced\" />",
40
" <ui:WixUI Id=\"WixUI_FeatureTree\" />",
41
- " <ui:WixUI Id=\"WixUI_BobsSpecialUI\" />",
41
+ " <UIRef Id=\"WixUI_BobsSpecialUI\" />",
42
" </UI>",
43
" </Fragment>",
44
"</Wix>"
@@ -50,7 +50,7 @@ namespace WixToolsetTest.Converters
50
var converter = new WixConverter(messaging, 2, null, null);
51
52
var errors = converter.ConvertDocument(document);
53
- Assert.Equal(7, errors);
53
+ Assert.Equal(5, errors);
54
55
var actualLines = UnformattedDocumentLines(document);
56
WixAssert.CompareLineByLine(expected, actualLines);