[LyX features/feature/docbook] DocBook: handle other cases of subfigures.

Thibaut Cuvelier tcuvelier at lyx.org
Sat Sep 12 01:18:38 UTC 2020


On Fri, 11 Sep 2020 at 13:41, Kornel Benko <kornel at lyx.org> wrote:

> Am Fri, 11 Sep 2020 13:01:29 +0200 (CEST)
> schrieb Thibaut Cuvelier <tcuvelier at lyx.org>:
>
> > commit 1fccfc24da4ad2f491b659ad7dcd8fbce29eef3d
> > Author: Thibaut Cuvelier <tcuvelier at lyx.org>
> > Date:   Fri Sep 11 03:14:41 2020 +0200
> >
> >     DocBook: handle other cases of subfigures.
> >
>
> In case of interest:
>
> The following tests FAILED:
> 5946 -
> export/examples/ru/Presentations/Beamer_Article_%28Standard_Class%29_docbook5
> (Failed)
> 6905 - export/templates/Posters/A0_Poster/Simple_docbook5 (Failed)
> 6940 - export/templates/Posters/SciPoster_docbook5 (Failed)
> Errors while running CTest
>

It really looks like dealing with posters is opening a bag of worms. Still,
with the latest patches, the last two documents should generate without
problem. I really say "should", because I am not sure why I had to do
convoluted things in ffef28772219aedf874a0747518116d144ddc3e5.

This is the code I tried before, but it mysteriously crashed in
hasDocumentSectioning (output_docbook.cpp), dereferencing paragraphs[bpit]
lead to a segmentation fault.

void InsetBox::docbook(XMLStream & xs, OutputParams const & runparams) const
{
   if (!getLayout().docbookwrappertag().empty()) {
      if (!xs.isLastTagCR())
         xs << xml::CR();

      xs << xml::StartTag(getLayout().docbookwrappertag(),
getLayout().docbookwrapperattr());
      xs << xml::CR();
   } else {
      LYXERR0("Assertion failed: box layout " + getLayout().name() + "
missing DocBookWrapperTag.");
   }

   OutputParams rp = runparams;

   // If the box starts with a sectioning item, use as box title.
   auto current_par = paragraphs().begin();
   if (current_par->layout().category() == from_utf8("Sectioning")) {
      // Only generate the first paragraph.
      current_par = makeAny(text(), buffer(), xs, runparams,
paragraphs().begin());

      rp.par_begin = std::distance(paragraphs().begin(), current_par);
      rp.par_end = paragraphs().size();
   }

   xs.startDivision(false);
   docbookParagraphs(text(), buffer(), xs, rp);
   xs.endDivision();

   if (!getLayout().docbookwrappertag().empty()) {
      if (!xs.isLastTagCR())
         xs << xml::CR();

      xs << xml::EndTag(getLayout().docbookwrappertag());
      xs << xml::CR();
   }
}

If you can have a look (or any one else, by the way), that would
really be appreciated :)!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-cvs/attachments/20200912/75fde391/attachment.html>


More information about the lyx-cvs mailing list