internal static TextContentRange TextContentRangeFromTrack(PtsContext ptsContext, IntPtr pfstrack) { PTS.FSTRACKDETAILS fstrackdetails; PTS.Validate(PTS.FsQueryTrackDetails(ptsContext.Context, pfstrack, out fstrackdetails)); TextContentRange textContentRange = new TextContentRange(); if (fstrackdetails.cParas != 0) { PTS.FSPARADESCRIPTION[] array; PtsHelper.ParaListFromTrack(ptsContext, pfstrack, ref fstrackdetails, out array); for (int i = 0; i < array.Length; i++) { BaseParaClient baseParaClient = ptsContext.HandleToObject(array[i].pfsparaclient) as BaseParaClient; PTS.ValidateHandle(baseParaClient); textContentRange.Merge(baseParaClient.GetTextContentRange()); } } return(textContentRange); }
internal TextContentRange GetTextContentRangeFromColumn(IntPtr pfstrack) { Invariant.Assert(!this.IsDisposed); PTS.FSTRACKDETAILS fstrackdetails; PTS.Validate(PTS.FsQueryTrackDetails(this.StructuralCache.PtsContext.Context, pfstrack, out fstrackdetails)); TextContentRange textContentRange = new TextContentRange(); if (fstrackdetails.cParas != 0) { PTS.FSPARADESCRIPTION[] array; PtsHelper.ParaListFromTrack(this.StructuralCache.PtsContext, pfstrack, ref fstrackdetails, out array); for (int i = 0; i < array.Length; i++) { BaseParaClient baseParaClient = this.StructuralCache.PtsContext.HandleToObject(array[i].pfsparaclient) as BaseParaClient; PTS.ValidateHandle(baseParaClient); textContentRange.Merge(baseParaClient.GetTextContentRange()); } } return(textContentRange); }
internal override TextContentRange GetTextContentRange() { TextElement textElement = base.Paragraph.Element as TextElement; Invariant.Assert(textElement != null, "Expecting TextElement as owner of ContainerParagraph."); PTS.FSSUBTRACKDETAILS fssubtrackdetails; PTS.Validate(PTS.FsQuerySubtrackDetails(base.PtsContext.Context, this._paraHandle.Value, out fssubtrackdetails)); TextContentRange textContentRange; if (fssubtrackdetails.cParas == 0 || (this._isFirstChunk && this._isLastChunk)) { textContentRange = TextContainerHelper.GetTextContentRangeForTextElement(textElement); } else { PTS.FSPARADESCRIPTION[] array; PtsHelper.ParaListFromSubtrack(base.PtsContext, this._paraHandle.Value, ref fssubtrackdetails, out array); textContentRange = new TextContentRange(); for (int i = 0; i < array.Length; i++) { BaseParaClient baseParaClient = base.Paragraph.StructuralCache.PtsContext.HandleToObject(array[i].pfsparaclient) as BaseParaClient; PTS.ValidateHandle(baseParaClient); textContentRange.Merge(baseParaClient.GetTextContentRange()); } if (this._isFirstChunk) { textContentRange.Merge(TextContainerHelper.GetTextContentRangeForTextElementEdge(textElement, ElementEdge.BeforeStart)); } if (this._isLastChunk) { textContentRange.Merge(TextContainerHelper.GetTextContentRangeForTextElementEdge(textElement, ElementEdge.AfterEnd)); } } Invariant.Assert(textContentRange != null); return(textContentRange); }
// Token: 0x06006B3E RID: 27454 RVA: 0x001EF93C File Offset: 0x001EDB3C internal void UpdateTextContentRangeFromAttachedObjects(TextContentRange textContentRange, int dcpFirst, int dcpLast, PTS.FSATTACHEDOBJECTDESCRIPTION[] arrayAttachedObjectDesc) { int num = dcpFirst; int num2 = 0; while (this._attachedObjects != null && num2 < this._attachedObjects.Count) { AttachedObject attachedObject = this._attachedObjects[num2]; int paragraphStartCharacterPosition = attachedObject.Para.ParagraphStartCharacterPosition; int cch = attachedObject.Para.Cch; if (paragraphStartCharacterPosition >= num && paragraphStartCharacterPosition < dcpLast) { textContentRange.Merge(new TextContentRange(num, paragraphStartCharacterPosition, base.StructuralCache.TextContainer)); num = paragraphStartCharacterPosition + cch; } if (dcpLast < num) { break; } num2++; } if (num < dcpLast) { textContentRange.Merge(new TextContentRange(num, dcpLast, base.StructuralCache.TextContainer)); } int num3 = 0; while (arrayAttachedObjectDesc != null && num3 < arrayAttachedObjectDesc.Length) { PTS.FSATTACHEDOBJECTDESCRIPTION fsattachedobjectdescription = arrayAttachedObjectDesc[num3]; BaseParaClient baseParaClient = base.PtsContext.HandleToObject(arrayAttachedObjectDesc[num3].pfsparaclient) as BaseParaClient; PTS.ValidateHandle(baseParaClient); textContentRange.Merge(baseParaClient.GetTextContentRange()); num3++; } }