@joebigelow / wix-1 / commits / 2b001acb

Add support for unreal columns

Rob Mensching committed Feb 5, 2020 at 14:33 UTC 2b001acb812edb523a072ac0bb4f49761616c080
2 files changed +24 -2
src/WixToolset.Data/WindowsInstaller/ColumnDefinition.cs
+18 -2
@@ -29,7 +29,7 @@ namespace WixToolset.Data.WindowsInstaller
29 /// <param name="modularizeType">Type of modularization for column</param>
30 /// <param name="forceLocalizable">If the column is localizable.</param>
31 /// <param name="useCData">If whitespace should be preserved in a CDATA node.</param>
32 - public ColumnDefinition(string name, ColumnType type, int length, bool primaryKey, bool nullable, ColumnCategory category, long? minValue = null, long? maxValue = null, string keyTable = null, int? keyColumn = null, string possibilities = null, string description = null, ColumnModularizeType? modularizeType = null, bool forceLocalizable = false, bool useCData = false)
32 + public ColumnDefinition(string name, ColumnType type, int length, bool primaryKey, bool nullable, ColumnCategory category, long? minValue = null, long? maxValue = null, string keyTable = null, int? keyColumn = null, string possibilities = null, string description = null, ColumnModularizeType? modularizeType = null, bool forceLocalizable = false, bool useCData = false, bool unreal = false)
33 {
34 this.Name = name;
35 this.Type = type;
@@ -46,6 +46,7 @@ namespace WixToolset.Data.WindowsInstaller
46 this.Possibilities = possibilities;
47 this.Description = description;
48 this.UseCData = useCData;
49 + this.Unreal = unreal;
50 }
51
52 /// <summary>
@@ -145,6 +146,12 @@ namespace WixToolset.Data.WindowsInstaller
146 /// <value>true if whitespace should be preserved in a CDATA node.</value>
147 public bool UseCData { get; }
148
149 + /// <summary>
150 + /// Gets if column is Unreal.
151 + /// </summary>
152 + /// <value>true if column should not be included in idts.</value>
153 + public bool Unreal { get; }
154 +
155 /// <summary>
156 /// Parses a column definition in a table definition.
157 /// </summary>
@@ -174,6 +181,7 @@ namespace WixToolset.Data.WindowsInstaller
181 bool primaryKey = false;
182 var type = ColumnType.Unknown;
183 bool useCData = false;
184 + bool unreal = false;
185
186 // parse the attributes
187 while (reader.MoveToNextAttribute())
@@ -370,6 +378,9 @@ namespace WixToolset.Data.WindowsInstaller
378 case "useCData":
379 useCData = reader.Value.Equals("yes");
380 break;
381 + case "unreal":
382 + unreal = reader.Value.Equals("yes");
383 + break;
384 }
385 }
386
@@ -396,7 +407,7 @@ namespace WixToolset.Data.WindowsInstaller
407 }
408 }
409
399 - ColumnDefinition columnDefinition = new ColumnDefinition(name, type, length, primaryKey, nullable, category, minValue, maxValue, keyTable, keyColumn, possibilities, description, modularize, localizable, useCData);
410 + ColumnDefinition columnDefinition = new ColumnDefinition(name, type, length, primaryKey, nullable, category, minValue, maxValue, keyTable, keyColumn, possibilities, description, modularize, localizable, useCData, unreal);
411 columnDefinition.Added = added;
412
413 return columnDefinition;
@@ -601,6 +612,11 @@ namespace WixToolset.Data.WindowsInstaller
612 writer.WriteAttributeString("useCData", "yes");
613 }
614
615 + if (this.Unreal)
616 + {
617 + writer.WriteAttributeString("unreal", "yes");
618 + }
619 +
620 writer.WriteEndElement();
621 }
622
src/WixToolset.Data/WindowsInstaller/TableDefinition.cs
+6
@@ -88,6 +88,12 @@ namespace WixToolset.Data.WindowsInstaller
88 var thisColumnDef = this.Columns[i];
89 var updatedColumnDef = updated.Columns[i];
90
91 + // Igmore unreal columns when comparing table definitions.
92 + if (thisColumnDef.Unreal || updatedColumnDef.Unreal)
93 + {
94 + continue;
95 + }
96 +
97 ret = thisColumnDef.CompareTo(updatedColumnDef);
98 }
99 }