Skip to main content
May 26, 2011
Answered

TLF Tabstops and textflow deep copy

  • May 26, 2011
  • 1 reply
  • 706 views

Hi,

I had a requirement where I had to make a deep copy of a textflow,I was under an impression that it would make a copy of this textflow.

Yes,it did make a copy of the textflow a new instance but the paragraph elements under this textflow were referencing to the same tabstop arrays which the original textflow was referencing.

Now is this a bug or is it supposed to be like this only.

-Ashar

This topic has been closed for replies.
Correct answer Jin-Huang

It is to save memory. 

The TabStops array and the actual TabStop object instances that are members of the array should be treated as read-only in the below cases.

1) once it is set into a TextLayoutFormat

2) when it is read from a TextLayoutFormat

3) when it is read from an implementer of ITextLayoutFormat

1 reply

Jin-HuangCorrect answer
Adobe Employee
May 27, 2011

It is to save memory. 

The TabStops array and the actual TabStop object instances that are members of the array should be treated as read-only in the below cases.

1) once it is set into a TextLayoutFormat

2) when it is read from a TextLayoutFormat

3) when it is read from an implementer of ITextLayoutFormat

May 27, 2011

So, in my case I will have to use the utility of copying the TabStops array and the new (copied) textflow should reference it instead of the actual arrays.