Andre Poenitz wrote:
> Not sure. I personally would lean to the first option, as the InsetBase
> ideally does not know anything about dialogs
>
> (which, of course is not true, as it has to declase 'hideDialog'...).
Not true. hideDialog need not be virtual if we adopt your 'guiding
principle', above. We could have:
class InsetBase {
virtual ~InsetBase() {}
};
class InsetCommand {
virtual ~InsetCommand() { hideDialog() };
/** classes derived from InsetCommand all have dialogs, each with
its own unique name. */
virtual string const & name() const = 0;
///
void hideDialog() {
BufferView * bv = cached_bufferview...;
bv->owner()->getDialogs().hide(name);
}
};
The only problem that remains is extracting the cached_bufferview (which is
a problem common to all these 'solutions'). Am I correct in saying that you
store it in the mathed insets? Could you move this store into InsetBase?
> I think it's like variable definition: Do it as late as possible but not
> to the extent where it hurts...
Thanks. I was looking for a guiding philosophy.
--
Angus