On Sat, Nov 03, 2007 at 12:00:42AM +0100, Abdelrazak Younes wrote: ...
> >> OK, I've done some cleanup an the crashes are gone but the inset layouts > >> are broken! > >> > >> Martin, Richard, do you have an idea here? I don't know if we shall we > >> fix Inset::getLayout() or if we shall assume that each inset hard-code > >> its own layout. > >> > >> Help please, > >> Abdel. > > Abdel, > > this is precisely the way _not_ to do it. The calls to setLayout() in the > > various insets are designed (by Jean-Marc during the Bromarv meeting) to > > get precisely the right insetlayout based on the inset's name(). > > Year I noticed that... calling virtual methods in ctors is dangerous and > should be avoided. OK... > > I fought with this fruitlessly until Jean-Marc showed me. You > > reverted to my old non-working code :-( > > Calm down, I found a better solution (appended below, I guess you cannot > read lyx-cvs?). Yes, but I didn't notice until later. Looks like you got it working again (?) but the thingy in Text3.cpp doesn't look pretty. > > Also, you shouldn't modify layout_ from within the inset. (can this be > > enforced by const?). > > We can do that yes. Would be a good thing. > > Can you not simply fully realize the labelfont (or a local > > copy) before using it in dimensionCollapsed()? A minimal fix. > > I fixed it by realizing it at setLayout() time. It works fine now but some > insets don't have entry in stdinsets.inc. OK... but I agree with your suspicion that this is better done in insetlayout parsing. > Abdel. - Martin