Skip to content

Commit

Permalink
2.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mustaddon committed Feb 2, 2024
1 parent 0a6f811 commit fba3b53
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
6 changes: 3 additions & 3 deletions ArrayToExcel/ArrayToExcel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<Nullable>enable</Nullable>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\ArrayToExcel.snk</AssemblyOriginatorKeyFile>
<AssemblyVersion>2.4.1</AssemblyVersion>
<FileVersion>2.4.1</FileVersion>
<Version>2.4.1</Version>
<AssemblyVersion>2.4.2</AssemblyVersion>
<FileVersion>2.4.2</FileVersion>
<Version>2.4.2</Version>
<Company></Company>
<Authors>Leonid Salavatov</Authors>
<Copyright>Leonid Salavatov 2024</Copyright>
Expand Down
6 changes: 3 additions & 3 deletions ArrayToExcel/CellDefault.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace ArrayToExcel;

public class CellDefault(object? value) : ICellValue
{
public void Apply(Cell cell, uint row) => Apply(cell, value);
public virtual void Apply(Cell cell, uint row) => Apply(cell, value);

internal static void Apply(Cell cell, object? value)
{
Expand All @@ -17,7 +17,7 @@ internal static void Apply(Cell cell, object? value)
cell.StyleIndex = cell.DataType == CellValues.Date ? 2 : 4u;
}

internal static CellValue GetCellValue(object? value)
static CellValue GetCellValue(object? value)
{
if (value == null) return new();

Expand Down Expand Up @@ -50,7 +50,7 @@ internal static string NormCellText(string value)
return RegularExpressions.InvalidXmlChars().Replace(value.Length > _maxCellText ? value.Substring(0, _maxCellText) : value, string.Empty);
}

internal static CellValues GetCellType(object? value)
static CellValues GetCellType(object? value)
{
var type = value?.GetType() ?? typeof(object);

Expand Down
2 changes: 1 addition & 1 deletion ArrayToExcel/CellFormula.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class CellFormula(Func<uint, string, string> cellText) : ICellValue
public CellFormula(Func<uint, string> rowText) : this((row, cell) => rowText(row)) { }
public CellFormula(string text) : this((row, col) => text) { }

public void Apply(Cell cell, uint row)
public virtual void Apply(Cell cell, uint row)
{
cell.CellFormula = new DocumentFormat.OpenXml.Spreadsheet.CellFormula(cellText(row, cell.CellReference!));
cell.StyleIndex = 4;
Expand Down
2 changes: 1 addition & 1 deletion ArrayToExcel/CellHyperlink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class CellHyperlink(string link, string? text = null) : ICellValue
public CellHyperlink(Uri link, string? text = null)
: this(link.ToString(), text ?? link.OriginalString) { }

public void Apply(Cell cell, uint row)
public virtual void Apply(Cell cell, uint row)
{
cell.CellFormula = new DocumentFormat.OpenXml.Spreadsheet.CellFormula(_format.Value);
cell.StyleIndex = 3;
Expand Down
7 changes: 3 additions & 4 deletions ArrayToExcel/CellPercent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

namespace ArrayToExcel;

public class CellPercent(object? value) : ICellValue
public class CellPercent(object? value) : CellDefault(value)
{
public void Apply(Cell cell, uint row)
public override void Apply(Cell cell, uint row)
{
cell.CellValue = CellDefault.GetCellValue(value);
cell.DataType = CellDefault.GetCellType(value);
base.Apply(cell, row);
cell.StyleIndex = 5;
}
}
2 changes: 1 addition & 1 deletion ArrayToExcel/CellText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace ArrayToExcel;

public class CellText(string? value, bool wrap = false) : ICellValue
{
public void Apply(Cell cell, uint row) => Apply(cell, value, wrap);
public virtual void Apply(Cell cell, uint row) => Apply(cell, value, wrap);

internal static void Apply(Cell cell, string? value, bool wrap)
{
Expand Down

0 comments on commit fba3b53

Please sign in to comment.