On Fri, 15 Sept 2023 at 11:36, Jürgen Spitzmüller <jspi...@gmail.com> wrote:

> Am Freitag, dem 15.09.2023 um 10:45 +0200 schrieb Léo de Souza:
> > 1. Create new document: File > New
> > 2. Insert label: Insert > Label...
> > 3. On a new line, switch layout to "Labeling" or "Description"
> > 4. Insert cross-reference: Insert > Cross-Reference...
> > 5. Try copying this cross-reference
> >
> > Expected result (LyX 2.3.6): The cross-reference is copied to the
> > clipboard.
> >
> > Actual result (LyX 2.4.0 beta 5): LyX crashes with the message
> > "SIGSEGV signal caught!"
>
>
> Nullpointer issue due to local_font being non-defined in
> InsetRef::xhtml().
>
> The attached patch fixes this particular case, but there are many
> similar uses in insets's xhtml methods which would need to be audited.
>
> Thibaut, Riki?
>

Your patch looks fine to me.

It looks cumbersome, especially if we need to do that several times; maybe
we could have a method at the inset level, say getLocalFontOrDefault(const
OutputParams&), to return either OutputParams::local_font if it exists or
buffer().params() otherwise? It would make correct code (much) easier to
write.

(Wasn't this bug caught at some point by a static analyser? It seems to be
a too common error in C++ for it to slip through.)
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to