Jean-Marc Lasgouttes wrote:
"Dov" == Dov Feldstern <[EMAIL PROTECTED]> writes:
Dov> Hmm, I just came across this yesterday when trying to figure out
Dov> what was going on with bug 3011, and wondered about it. I'm not
Dov> sure if this is what you mean or not, but it might be relevant...
Dov>
http://www.lyx.org/trac/browser/lyx-devel/trunk/src/Paragraph.cpp?rev=18599#L446
Yes, what I mean is that in this case we would have to recreate the
structure instead of update it. I do not know how costly it is but
Abdel is confident that it is not a problem.
JMarc
Why do we need that structure at all? Given that our char_type is
32-bits, and we don't use all 32, we could do something like the
following: the insets themselves could be stored in a hash table,
without storing their positions in that structure. At each position in
the paragraph where an inset appears, instead of just the META_INSET
character, we store an actual key into the hash table. (From the comment
on META_INSET I understand that we don't use any values above 0x20001
--- which means that we have more than enough room for keys to as many
insets as we'd like in a single paragraph...). Then, there's no need of
keeping the insets structure in sync with the paragraph itself after
every insertion...