Browse Source

HWPF.Model.CHPBinTable.Rebuild(): Don't try to operate on an invalidated enumerator (avoids an InvalidOperationException)

pull/569/head
datadiode 4 years ago
parent
commit
085297293c
  1. 10
      scratchpad/HWPF/Model/CHPBinTable.cs

10
scratchpad/HWPF/Model/CHPBinTable.cs

@ -282,13 +282,13 @@ namespace NPOI.HWPF.Model
start = DateTime.Now.Ticks;
CHPX previous = null;
for (List<CHPX>.Enumerator iterator = _textRuns.GetEnumerator(); iterator
.MoveNext(); )
for (int iterator = _textRuns.Count; iterator != 0; )
{
CHPX current = iterator.Current;
if (previous == null)
CHPX current = previous;
previous = _textRuns[--iterator];
if (current == null)
{
previous = current;
continue;
}

Loading…
Cancel
Save