> Note that reference to an inset is a very fragile thing. I guess that
> an undo-redo cycle will reallocate the inset.

Stored insets are used in two ways:

1. navigation. Because I compare a stored inset pointer with currently
available ones. If the stored pointer does not exist, navigation of
that file item fail. On the other hand, this operation will not crash
lyx so it is not a big problem.

2. change filename used by an inset (not yet committed). When
embedding is enabled, and the embedding status of a file is changed,
all insets that refer to that file will be updated to use appropriate
filename. This is more dangerous so validate the pointer before such
an operation. It would be safer to do a EmbeddedFiles::update()
though.

Cheers,
Bo

Reply via email to