Uwe Stöhr wrote:
> > the problem is what happens when width_str is empty. then no width_str[0]
> > exists and accessing it is asking for crash.
>
> This string could not be empty because it was always filled by 
> InsetCommandParams. The crash occurred after Abdel's transformation of 
> GuiLine to InsetWidgets which doesn't support default values at inserting 
> an inset (it at least seems so).

i'm not sure you got my point. my point was that the code was written in a
dangerous way, not who is originally responsible for the crash. strictly
speaking it was always filled by Qt and any slight change either in Qt or our
code would make it unstable -- that is bad programming practise.

one should avoid checking emptiness only in case some nearby code does check it
before and never be dependent on what some other qt/lyx units. robustness means
you always treat other (non-local) parts of the code as your enemies :)

pavel

Reply via email to