Skip to content

Commit 36785ef

Browse files
OssianEPPlusswmal
andauthored
Added fix for custom iconsets (#2042)
* Added fix for custom iconsets * Update WorksheetXmlWriter.cs Removed commented code --------- Co-authored-by: Mats Alm <897655+swmal@users.noreply.github.com>
1 parent 875c9f7 commit 36785ef

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/EPPlus/ConditionalFormatting/Contracts/IExcelConditionalFormattingFourIconSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public interface IExcelConditionalFormattingFourIconSet<T> : IExcelConditionalFo
2424
{
2525
#region Public Properties
2626
/// <summary>
27-
/// Icon4 (part of the 4 ou 5 Icon Set)
27+
/// Icon4 (part of the 4 or 5 Icon Set)
2828
/// </summary>
2929
ExcelConditionalFormattingIconDataBarValue Icon4 { get; }
3030
#endregion Public Properties

src/EPPlus/Core/Worksheet/XmlWriter/WorksheetXmlWriter.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,10 +1347,7 @@ private string GetXMLCFExt(string prefix, ExcelConditionalFormattingRule format,
13471347
cache.Append($"<{prefix}cfRule type=\"iconSet\" priority=\"{format.Priority}\" id=\"{{{uid}}}\">");
13481348
cache.Append($"<{prefix}iconSet ");
13491349

1350-
if (isCustom == false)
1351-
{
1352-
cache.Append($"iconSet=\"{iconSetString}\"");
1353-
}
1350+
cache.Append($"iconSet=\"{iconSetString}\"");
13541351

13551352
if (showValue == false)
13561353
{

src/EPPlusTest/ConditionalFormatting/CF_IconSetTests.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,5 +611,18 @@ public void CF_IconSetReadIDGenerated()
611611
SaveAndCleanup(p);
612612
}
613613
}
614+
[TestMethod]
615+
public void CF_IconSetReadCUSTOMEXCEL()
616+
{
617+
string id = "";
618+
using (var p = OpenTemplatePackage("IconTest_CF.xlsx"))
619+
{
620+
var ws = p.Workbook.Worksheets[0];
621+
ws.Cells["B1"].Value = 5;
622+
623+
SaveAndCleanup(p);
624+
}
625+
}
626+
614627
}
615628
}

0 commit comments

Comments
 (0)