From 7c04bfdb54ccf5b4b67995c9715a3f7f9e454206 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 7 Apr 2020 11:20:36 +1000 Subject: Fix bugs when compiling UI.wixext --- src/WixToolset.Core/Compiler_UI.cs | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'src/WixToolset.Core/Compiler_UI.cs') diff --git a/src/WixToolset.Core/Compiler_UI.cs b/src/WixToolset.Core/Compiler_UI.cs index 8a425fd4..60e89d12 100644 --- a/src/WixToolset.Core/Compiler_UI.cs +++ b/src/WixToolset.Core/Compiler_UI.cs @@ -465,12 +465,12 @@ namespace WixToolset.Core { case "Control": // These are all thrown away. - IntermediateTuple lastTabRow = null; + ControlTuple lastTabTuple = null; string firstControl = null; string defaultControl = null; string cancelControl = null; - this.ParseControlElement(child, id.Id, TupleDefinitionType.BBControl, ref lastTabRow, ref firstControl, ref defaultControl, ref cancelControl); + this.ParseControlElement(child, id.Id, TupleDefinitionType.BBControl, ref lastTabTuple, ref firstControl, ref defaultControl, ref cancelControl); break; default: this.Core.UnexpectedElement(node, child); @@ -954,7 +954,7 @@ namespace WixToolset.Core id = Identifier.Invalid; } - IntermediateTuple lastTabRow = null; + ControlTuple lastTabTuple = null; string cancelControl = null; string defaultControl = null; string firstControl = null; @@ -966,7 +966,7 @@ namespace WixToolset.Core switch (child.Name.LocalName) { case "Control": - this.ParseControlElement(child, id.Id, TupleDefinitionType.Control, ref lastTabRow, ref firstControl, ref defaultControl, ref cancelControl); + this.ParseControlElement(child, id.Id, TupleDefinitionType.Control, ref lastTabTuple, ref firstControl, ref defaultControl, ref cancelControl); break; default: this.Core.UnexpectedElement(node, child); @@ -979,11 +979,11 @@ namespace WixToolset.Core } } - if (null != lastTabRow && null != lastTabRow[1]) + if (null != lastTabTuple && null != lastTabTuple.Control) { - if (firstControl != lastTabRow[1].ToString()) + if (firstControl != lastTabTuple.Control) { - lastTabRow.Set(10, firstControl); + lastTabTuple.NextControlRef = firstControl; } } @@ -1027,12 +1027,12 @@ namespace WixToolset.Core /// Element to parse. /// Identifier for parent dialog. /// Table control belongs in. - /// Last row in the tab order. + /// Last control in the tab order. /// Name of the first control in the tab order. /// Name of the default control. /// Name of the candle control. /// True if the containing dialog tracks disk space. - private void ParseControlElement(XElement node, string dialog, TupleDefinitionType tupleType, ref IntermediateTuple lastTabTuple, ref string firstControl, ref string defaultControl, ref string cancelControl) + private void ParseControlElement(XElement node, string dialog, TupleDefinitionType tupleType, ref ControlTuple lastTabTuple, ref string firstControl, ref string defaultControl, ref string cancelControl) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); Identifier controlId = null; @@ -1529,7 +1529,15 @@ namespace WixToolset.Core if (!notTabbable) { - if (TupleDefinitionType.BBControl == tupleType) + if (tuple is ControlTuple controlTuple) + { + if (null != lastTabTuple) + { + lastTabTuple.NextControlRef = controlTuple.Control; + } + lastTabTuple = controlTuple; + } + else if (tuple != null) { this.Core.Write(ErrorMessages.TabbableControlNotAllowedInBillboard(sourceLineNumbers, node.Name.LocalName, controlType)); } @@ -1538,12 +1546,6 @@ namespace WixToolset.Core { firstControl = controlId.Id; } - - if (null != lastTabTuple) - { - lastTabTuple.Set(10, controlId.Id); - } - lastTabTuple = tuple; } // bitmap and icon controls contain a foreign key into the binary table in the text column; -- cgit v1.2.3-55-g6feb