Lior Silberman <[EMAIL PROTECTED]> writes:

| Perhaps holding a pointer to the owning paragraph whould server us
|  better?

No, I don't think so...

| Insets can be either in the top-level document (owned by a paragraph) or
| inside other insets. Thus insets have an Inset* 'owner' member, but no
| pointer for the first case. This can be contrasted with the LyXText class,
| which can be owner by either a Buffer_View or an InsetText.
| 
| This also allows easier deletion of an inset, given only a pointer to the
| inset (you don't have to search for the paragraph) - maybe even implement
| Inset::delete_yourself() (which removes the inset from the respective
| owner, and then deletes 'this').

This gives code that is impossible to follow and has a tendency to be
hard to maintain. (And makes the use of standard algorithms very hard)

| class Inset {
|       LyXParagraph * owner_par;
| 
|       bool isInserted() { return (owner_par!=NULL) || (owner!=NULL)); }
| };

nah.

We don't want owner or owner_par in LyXInsets.

        Lgb

Reply via email to