Skip to content

Commit

Permalink
Merge pull request #1432 from antony-liu/master
Browse files Browse the repository at this point in the history
fix: Make test case TestSumif.TestMicrosoftExample1 passed
  • Loading branch information
tonyqus authored Oct 19, 2024
2 parents f662c5c + 7f77af6 commit a74f96c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions main/SS/Formula/CellEvaluationFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace NPOI.SS.Formula

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NPOI.SS.Formula.Eval;

Expand All @@ -30,13 +32,13 @@ class CellEvaluationFrame
{

private FormulaCellCacheEntry _cce;
private ArrayList _sensitiveInputCells;
private ISet<CellCacheEntry> _sensitiveInputCells;
private FormulaUsedBlankCellSet _usedBlankCellGroup;

public CellEvaluationFrame(FormulaCellCacheEntry cce)
{
_cce = cce;
_sensitiveInputCells = new ArrayList();
_sensitiveInputCells = new HashSet<CellCacheEntry>();
}
public CellCacheEntry GetCCE()
{
Expand Down Expand Up @@ -68,9 +70,7 @@ private CellCacheEntry[] GetSensitiveInputCells()
{
return CellCacheEntry.EMPTY_ARRAY;
}
CellCacheEntry[] result = new CellCacheEntry[nItems];
result = (CellCacheEntry[])_sensitiveInputCells.ToArray(typeof(CellCacheEntry));
return result;
return _sensitiveInputCells.ToArray();
}
public void AddUsedBlankCell(int bookIndex, int sheetIndex, int rowIndex, int columnIndex)
{
Expand Down
11 changes: 6 additions & 5 deletions main/SS/Formula/EvaluationTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace NPOI.SS.Formula

using System;
using System.Collections;
using System.Collections.Generic;
using NPOI.SS.Formula.Eval;


Expand All @@ -36,15 +37,15 @@ namespace NPOI.SS.Formula
public class EvaluationTracker
{
// TODO - consider deleting this class and letting CellEvaluationFrame take care of itself
private IList _evaluationFrames;
private IList _currentlyEvaluatingCells;
private IList<CellEvaluationFrame> _evaluationFrames;
private ISet<FormulaCellCacheEntry> _currentlyEvaluatingCells;
private EvaluationCache _cache;

public EvaluationTracker(EvaluationCache cache)
{
_cache = cache;
_evaluationFrames = new ArrayList();
_currentlyEvaluatingCells = new ArrayList();
_evaluationFrames = new List<CellEvaluationFrame>();
_currentlyEvaluatingCells = new HashSet<FormulaCellCacheEntry>();
}

/**
Expand Down Expand Up @@ -116,7 +117,7 @@ public void EndEvaluate(CellCacheEntry cce)
}
// else - no problems so pop current frame
_evaluationFrames.RemoveAt(nFrames);
_currentlyEvaluatingCells.Remove(cce);
_currentlyEvaluatingCells.Remove((FormulaCellCacheEntry) cce);
}

public void AcceptFormulaDependency(CellCacheEntry cce)
Expand Down

0 comments on commit a74f96c

Please sign in to comment.