diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Cells/IXLCell.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Cells/IXLCell.cs index 72a822b..309952b 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Cells/IXLCell.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Cells/IXLCell.cs @@ -130,6 +130,8 @@ IXLRange InsertData(IEnumerable data); IXLTable InsertTable(IEnumerable data); + IXLTable InsertTable(IEnumerable data, Boolean createTable); IXLTable InsertTable(IEnumerable data, String tableName); + IXLTable InsertTable(IEnumerable data, String tableName, Boolean createTable); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook.cs index 9ebc2da..f14bff7 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook.cs @@ -307,16 +307,9 @@ return Worksheets.Worksheet(position); } - private HashSet addedSharedStrings = new HashSet(); - public void AddSharedString(String value) - { - addedSharedStrings.Add(value); - } - public HashSet GetSharedStrings() { HashSet modifiedStrings = new HashSet(); - addedSharedStrings.ForEach(s => modifiedStrings.Add(s)); foreach (var w in Worksheets.Cast()) { foreach (var c in w.Internals.CellsCollection.Values) @@ -324,6 +317,7 @@ if ( c.DataType == XLCellValues.Text && !StringExtensions.IsNullOrWhiteSpace(c.InnerText) + && c.ShareString && !modifiedStrings.Contains(c.Value.ToString()) ) { diff --git a/ClosedXML/ClosedXML/ClosedXML_Examples/Misc/DataTypes.cs b/ClosedXML/ClosedXML/ClosedXML_Examples/Misc/DataTypes.cs index 12946f8..bebe5f5 100644 --- a/ClosedXML/ClosedXML/ClosedXML_Examples/Misc/DataTypes.cs +++ b/ClosedXML/ClosedXML/ClosedXML_Examples/Misc/DataTypes.cs @@ -167,8 +167,7 @@ var cell = ws.Cell(ro, co + 1); cell.Value = "Not Shared"; cell.ShareString = false; - // You can also add your own strings to the workbook's shared strings pool: - // workbook.AddSharedString("custom shared string"); + // To view all shared strings (all texts in the workbook actually), use the following: // workbook.GetSharedStrings()