Alters the first range so it encompasses the second range.
This assumes that range1 intersects range2.
164 var startPosition1 = range1.StartOffset;
165 var start1 = range1.StartValue;
166 var endPosition1 = range1.EndOffset;
167 var end1 = range1.EndValue;
169 var startPosition2 = range2.StartOffset;
170 var start2 = range2.StartValue;
171 var endPosition2 = range2.EndOffset;
172 var end2 = range2.EndValue;
174 if (!start1.Equals(IndexRange.FirstInSet)) {
175 if (!start2.Equals(IndexRange.FirstInSet)) {
177 int c = cell.CompareTo(start2);
182 startPosition1 = startPosition2;
186 startPosition1 = startPosition2;
190 if (!end1.Equals(IndexRange.LastInSet)) {
191 if (!end2.Equals(IndexRange.LastInSet)) {
193 int c = cell.CompareTo(end2);
198 endPosition1 = endPosition2;
202 endPosition1 = endPosition2;
206 return new IndexRange(startPosition1, start1, endPosition1, end1);
RangeFieldOffset
The absolute offset of a field in a range of a selection.