On Sat, Nov 22, 2003 at 11:58:56AM +0100, Lars Gullik Bj�nnes wrote:
> 
> As far as I can see
> 
> LyXText(LyXText const &) is prohibited due to back pointers (so the
> comment says), but operator=(LyXText const &) is allowed.

I think LyXText is still non-copiable (semantic-wise, syntactically it
should work...) but operator=() just happens to work in the only
circumstances where it is used (InsetText::operator=). I haven't look
into that issues for a long time now, but I'd suspect inset_owner_ and
paragraphs_ to be the offending items.

I've gradually worked on the removal of inset_owner_ but not checked
lately how much needs to be done there. paragraphs_ should IMO be not a
pointer but the real paragraph list. 

> Anyhow... the reason I am bringing this up is that the LyXText is not
> really copyable (at least not with default copy assignment) since it
> contains iterator variables. So when a copy is done, the iterator will
> still point to  the old object...

The only iterator I know of is cache_par_ and this is currently not
used. It was a speed-hack only but Alfredo figured out that this was the
causes for some crashes.

> For now I'll just create a copy assignment function, it is possible
> that we should also lift the prohibition of the copy constructor.

I am a big fan of copiable classes...

Andre'

Reply via email to