diff options
-rw-r--r-- | src/WixToolset.Converters.Symbolizer/ConvertSymbols.cs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/WixToolset.Converters.Symbolizer/ConvertSymbols.cs b/src/WixToolset.Converters.Symbolizer/ConvertSymbols.cs index c2bc8d29..fd12dc2a 100644 --- a/src/WixToolset.Converters.Symbolizer/ConvertSymbols.cs +++ b/src/WixToolset.Converters.Symbolizer/ConvertSymbols.cs | |||
@@ -39,7 +39,7 @@ namespace WixToolset.Converters.Symbolizer | |||
39 | var symbol = GenerateSymbolFromRow(row, wixMediaByDiskId, componentsById, fontsById, bindPathsById, selfRegById, wixFileById, wixDirectoryById); | 39 | var symbol = GenerateSymbolFromRow(row, wixMediaByDiskId, componentsById, fontsById, bindPathsById, selfRegById, wixFileById, wixDirectoryById); |
40 | if (symbol != null) | 40 | if (symbol != null) |
41 | { | 41 | { |
42 | section.Symbols.Add(symbol); | 42 | section.AddSymbol(symbol); |
43 | } | 43 | } |
44 | } | 44 | } |
45 | } | 45 | } |
@@ -733,11 +733,13 @@ namespace WixToolset.Converters.Symbolizer | |||
733 | 733 | ||
734 | private static IntermediateSymbol DefaultSymbolFromRow(Type symbolType, Wix3.Row row, bool columnZeroIsId) | 734 | private static IntermediateSymbol DefaultSymbolFromRow(Type symbolType, Wix3.Row row, bool columnZeroIsId) |
735 | { | 735 | { |
736 | var symbol = Activator.CreateInstance(symbolType) as IntermediateSymbol; | 736 | var id = columnZeroIsId ? GetIdentifierForRow(row) : null; |
737 | |||
738 | var createSymbol = symbolType.GetConstructor(new[] { typeof(SourceLineNumber), typeof(Identifier) }); | ||
739 | var symbol = (IntermediateSymbol)createSymbol.Invoke(new object[] { SourceLineNumber4(row.SourceLineNumbers), id }); | ||
737 | 740 | ||
738 | SetSymbolFieldsFromRow(row, symbol, columnZeroIsId); | 741 | SetSymbolFieldsFromRow(row, symbol, columnZeroIsId); |
739 | 742 | ||
740 | symbol.SourceLineNumbers = SourceLineNumber4(row.SourceLineNumbers); | ||
741 | return symbol; | 743 | return symbol; |
742 | } | 744 | } |
743 | 745 | ||
@@ -747,7 +749,11 @@ namespace WixToolset.Converters.Symbolizer | |||
747 | var fieldDefinitions = columnDefinitions.Select(columnDefinition => | 749 | var fieldDefinitions = columnDefinitions.Select(columnDefinition => |
748 | new IntermediateFieldDefinition(columnDefinition.Name, ColumnType3ToIntermediateFieldType4(columnDefinition.Type))).ToArray(); | 750 | new IntermediateFieldDefinition(columnDefinition.Name, ColumnType3ToIntermediateFieldType4(columnDefinition.Type))).ToArray(); |
749 | var symbolDefinition = new IntermediateSymbolDefinition(row.Table.Name, fieldDefinitions, null); | 751 | var symbolDefinition = new IntermediateSymbolDefinition(row.Table.Name, fieldDefinitions, null); |
750 | var symbol = new IntermediateSymbol(symbolDefinition, SourceLineNumber4(row.SourceLineNumbers)); | 752 | |
753 | var id = columnZeroIsId ? GetIdentifierForRow(row) : null; | ||
754 | |||
755 | var createSymbol = typeof(IntermediateSymbol).GetConstructor(new[] { typeof(IntermediateSymbolDefinition), typeof(SourceLineNumber), typeof(Identifier) }); | ||
756 | var symbol = (IntermediateSymbol)createSymbol.Invoke(new object[] { symbolDefinition, SourceLineNumber4(row.SourceLineNumbers), id }); | ||
751 | 757 | ||
752 | SetSymbolFieldsFromRow(row, symbol, columnZeroIsId); | 758 | SetSymbolFieldsFromRow(row, symbol, columnZeroIsId); |
753 | 759 | ||
@@ -756,10 +762,9 @@ namespace WixToolset.Converters.Symbolizer | |||
756 | 762 | ||
757 | private static void SetSymbolFieldsFromRow(Wix3.Row row, IntermediateSymbol symbol, bool columnZeroIsId) | 763 | private static void SetSymbolFieldsFromRow(Wix3.Row row, IntermediateSymbol symbol, bool columnZeroIsId) |
758 | { | 764 | { |
759 | int offset = 0; | 765 | var offset = 0; |
760 | if (columnZeroIsId) | 766 | if (columnZeroIsId) |
761 | { | 767 | { |
762 | symbol.Id = GetIdentifierForRow(row); | ||
763 | offset = 1; | 768 | offset = 1; |
764 | } | 769 | } |
765 | 770 | ||