rgheck wrote:
Or are there some that don't need it? or want it?
Here's the point of the question. There are surely still places in the
code where insets get constructed and their buffers don't get set. We
can hunt these down one crash at a time and probably still miss some or
we can do something more general. The way to do the latter would seem to
be to change:
/// Constructor
explicit Inset() : buffer_(0) {}
to
explicit Inset::Inset(Buffer const & buf) :
buffer_(const_cast<Buffer *>(&buf)) {}
and then every Inset will HAVE to set its Buffer. Making that work seems
to be just a matter of making it compile. Which will take a while, since
a lot of constructors will have to be updated, but it will just be grunt
work.
If there are Insets we think should be excluded, perhaps we can subclass
Inset as InsetBuffer (or whatever) and make everything except the ones
that don't need a Buffer inherit from InsetBuffer. But maybe having a
Buffer doesn't hurt, anyway.
Thoughts?
rh