public bool ProcessElement(IElementProcessingState state, FieldCode fc) { var offset = new VTextOffset { Delta = fc.InnerText.Length * -1, Index = state.Index }; state.CurrentVNode.VOffsets.Add(offset); state.Index += offset.Delta * -1; return(false); }
private void Iterate() { _textIndex = 0; _i = _first.Index; _currentOffset = null; while (_i < _targetI) { while (_currentOffset == null && _offsets.Any() && _offsets.First().Index == _i) { var offset = _offsets.First(); if (offset.Delta > 0) { _offsets.RemoveAt(0); _firstOffsets.Add(offset); _textIndex += offset.Delta; } else if (offset.Delta < 0) { _currentOffset = offset; _offsetIndex = 0; } } _first.Length++; _second.Length--; if (_currentOffset == null) { _textIndex++; } else { _offsetIndex--; if (_offsetIndex == _currentOffset.Delta) { _firstOffsets.Add(_currentOffset); _offsets.RemoveAt(0); _currentOffset = null; } } _i++; } }