Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make test case TestSumif.TestMicrosoftExample1 passed #1432

Merged
merged 2 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading