Skip to content

Commit 8b664ef

Browse files
committed
EPPlus version 5.8.3
1 parent 27a0353 commit 8b664ef

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

appveyor.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
version: 5.8.2.{build}
1+
version: 5.8.3.{build}
22
branches:
33
only:
44
- develop
55
configuration: release
66
platform: Any CPU
77
init:
88
- ps: >-
9-
Update-AppveyorBuild -Version "5.8.2.$env:appveyor_build_number-$(Get-Date -format yyyyMMdd)-$env:appveyor_repo_branch"
9+
Update-AppveyorBuild -Version "5.8.3.$env:appveyor_build_number-$(Get-Date -format yyyyMMdd)-$env:appveyor_repo_branch"
1010
11-
Write-Host "5.8.2.$env:appveyor_build_number-$(Get-Date -format yyyyMMdd)-$env:appveyor_repo_branch"
11+
Write-Host "5.8.3.$env:appveyor_build_number-$(Get-Date -format yyyyMMdd)-$env:appveyor_repo_branch"
1212
dotnet_csproj:
1313
patch: true
1414
file: '**\*.csproj'
1515
version: '{version}'
16-
assembly_version: 5.8.2.{build}
17-
file_version: 5.8.2.{build}
16+
assembly_version: 5.8.3.{build}
17+
file_version: 5.8.3.{build}
1818
nuget:
1919
project_feed: true
2020
before_build:

docs/articles/fixedissues.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# Features / Fixed issues - EPPlus 5
2+
## Version 5.8.3
3+
### Fixed issues
4+
* Inserting rows into a worksheet sometimes didn't update addresses on workbook defined names.
5+
* Overlapping data validation addresses was validated on save which cause workbooks containing such not to be saved.
6+
* Failed to copy cells when data validations or conditional formatting was set.
7+
* COUNTIFS, AVERAGEIFS and SUMIFS fails with single cell ranges.
8+
* Packages with VBA project with a component reference with encoded characters causes the saved package to become corrupt.
9+
* It was not possible to specify legend entry properties for items from secondary y-axis.
10+
211
## Version 5.8.2
312
### Fixed issues
413
* Range.Text returned the wrong value for format #.##0"*";(#.##0)"*" on negative values

src/EPPlus/ExcelAddressBase.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ internal string AddressSpaceSeparated
674674
/// </summary>
675675
protected void Validate()
676676
{
677-
if (_fromRow > _toRow || _fromCol > _toCol)
677+
if ((_fromRow > _toRow || _fromCol > _toCol) && (_toRow!=0)) //_toRow==0 is #REF!
678678
{
679679
throw new ArgumentOutOfRangeException("Start cell Address must be less or equal to End cell address");
680680
}
@@ -1418,12 +1418,13 @@ public string LocalAddress
14181418
{
14191419
get
14201420
{
1421-
var ix = _address.TrimEnd().LastIndexOf('!', _address.Length - 2); //Last index can be ! if address is #REF!, so check from
1421+
var localAddress = FirstAddress;
1422+
var ix = localAddress.TrimEnd().LastIndexOf('!', localAddress.Length - 2); //Last index can be ! if address is #REF!, so check from
14221423
if (ix>=0)
14231424
{
1424-
return _address.Substring(ix + 1);
1425+
return localAddress.Substring(ix + 1);
14251426
}
1426-
return _address;
1427+
return localAddress;
14271428
}
14281429
}
14291430
/// <summary>

src/EPPlus/ExcelCellBase.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ internal static bool GetRowColFromAddress(string CellAddress, out int FromRow, o
290290
FromColumn = 1;
291291
if (FromRow <= 0)
292292
FromRow = 1;
293-
if (ToColumn <= 0)
293+
if (ToColumn <= 0 && (cells.Length<=1 || (cells.Length > 1 && cells[1].Equals("#REF!",StringComparison.OrdinalIgnoreCase) == false)))
294294
ToColumn = ExcelPackage.MaxColumns;
295-
if (ToRow <= 0)
295+
if (ToRow <= 0 && (cells.Length <= 1 || (cells.Length > 1 && cells[1].Equals("#REF!", StringComparison.OrdinalIgnoreCase) == false)))
296296
ToRow = ExcelPackage.MaxRows;
297297

298298
}
@@ -320,6 +320,7 @@ private static void SetToRowCol(ref int toRowCol, ref bool fixedToRowCol, int ro
320320

321321
private static bool IsCellAddress(string cellAddress)
322322
{
323+
if (cellAddress.Equals("#REF!", StringComparison.OrdinalIgnoreCase)) return true;
323324
int alpha = 0;
324325
bool num = false;
325326
for(int i=0;i<cellAddress.Length;i++)
@@ -653,7 +654,7 @@ internal static string GetFullAddress(string worksheetName, string address, bool
653654
{
654655
wsForAddress = GetQuotedWorksheetName(worksheetName);
655656
}
656-
if (address.IndexOf('!') == -1 || address == "#REF!")
657+
if (address.IndexOf('!') == -1 || address.Contains("#REF!"))
657658
{
658659
if (fullRowCol)
659660
{

0 commit comments

Comments
 (0)