]> git.lyx.org Git - features.git/commitdiff
DocBook, InsetFloat: avoid a potential nullptr dereference when detecting the type...
authorThibaut Cuvelier <tcuvelier@lyx.org>
Sun, 20 Feb 2022 20:30:39 +0000 (21:30 +0100)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Sun, 20 Feb 2022 20:31:13 +0000 (21:31 +0100)
src/insets/InsetFloat.cpp

index cb05e49aa6b57c91ccd669df653ded358ea2b58c..981d61155a8e2566f6681ab8aa91db539569c0a9 100644 (file)
@@ -819,12 +819,15 @@ void docbookNoSubfigures(XMLStream & xs, OutputParams const & runparams, const I
        }
 
        // - Output the actual content of the float or some dummy content (to ensure that the output
-       // document is valid).
+       // document is valid). Use HTML tables by default, unless an InsetFloat is given.
        if (hasFloat)
                xs << XMLStream::ESCAPE_NONE << osFloatContent.str();
-       else if (ftype.docbookFloatType() == "table")
-               docbookGenerateFillerTable(xs, thisFloat->buffer().params().docbook_table_output);
-       else
+       else if (ftype.docbookFloatType() == "table") {
+               BufferParams::TableOutput tableFormat = BufferParams::HTMLTable;
+               if (thisFloat)
+                       tableFormat = thisFloat->buffer().params().docbook_table_output;
+               docbookGenerateFillerTable(xs, tableFormat);
+       } else
                docbookGenerateFillerMedia(xs);
 
        // - Close the float.