On Fri, Nov 02, 2007 at 06:51:54PM +0100, Abdelrazak Younes wrote:
>  Martin Vermeer wrote:
> > On Fri, Nov 02, 2007 at 12:45:49PM +0100, Helge Hafting wrote:
> >>  Start lyx, open a "recent document" - assert.
> >>
> >>  Case one (A11.lyx, beamer presentation)
> > ...  
> >>  Program received signal SIGSEGV, Segmentation fault.
> >>  [Switching to Thread 0xa62949b0 (LWP 10363)]
> >>  0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8)
> >>     at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178
> >>  178                     layout_.labelstring, dim.wid, dim.asc, dim.des);
> >>  (gdb) bt
> >>  #0  0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed 
> >> (this=0x8c5a5e8)
> >>     at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178
> >>  #1  0x083301ef in lyx::InsetCollapsable::metrics (this=0x8c5a5e8,
> >>     [EMAIL PROTECTED], [EMAIL PROTECTED])
> >>     at ../../lyx-devel/src/insets/InsetCollapsable.cpp:218
> >>  #2  0x0834eca8 in lyx::InsetFootlike::metrics (this=0x8c5a5e8,  
> >> [EMAIL PROTECTED],
> > This is similar to the earlier reported bug for ERT.
> > From memory (I am travelling) the fix is to replace the call
> > in the constructor to InsetCollapse(bp) or ...(bp, status)
> > by ...(bp, collapse). In ERT, Footlike, perhaps more.
> > There is something fishy here that needs fixing at a more
> > fundamental level, but please try this first as I cannot do
> > much from here now.
> 
>  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().

I fought with this fruitlessly until Jean-Marc showed me. You
reverted to my old non-working code :-(

Also, you shouldn't modify layout_ from within the inset. 
(can this be enforced by const?).

Can you not simply fully realize the labelfont (or a  local
copy) before using it in dimensionCollapsed()? A minimal fix.

- Martin

Reply via email to