X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Foutput_docbook.cpp;h=48b2f605e75233d9ca74d57bfaaa593b721c4365;hb=43dd383073fc61cfe5f24b87294c4e8698a1827a;hp=9dfa256eb81bbe2fbbe589ae750ae61ea50c4d81;hpb=9236a93894f6a182eb17a219b216eff747e50a27;p=lyx.git diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp index 9dfa256eb8..48b2f605e7 100644 --- a/src/output_docbook.cpp +++ b/src/output_docbook.cpp @@ -30,8 +30,7 @@ #include "support/lassert.h" #include "support/debug.h" #include "support/lstrings.h" - -#include +#include "support/lyxalgo.h" using namespace std; using namespace lyx::support; @@ -42,7 +41,7 @@ namespace { ParagraphList::const_iterator searchParagraph( ParagraphList::const_iterator p, - ParagraphList::const_iterator const & pend) + ParagraphList::const_iterator const & pend) { for (++p; p != pend && p->layout().latextype == LATEX_PARAGRAPH; ++p) ; @@ -52,8 +51,8 @@ ParagraphList::const_iterator searchParagraph( ParagraphList::const_iterator searchCommand( - ParagraphList::const_iterator p, - ParagraphList::const_iterator const & pend) + ParagraphList::const_iterator p, + ParagraphList::const_iterator const & pend) { Layout const & bstyle = p->layout(); @@ -68,8 +67,8 @@ ParagraphList::const_iterator searchCommand( ParagraphList::const_iterator searchEnvironment( - ParagraphList::const_iterator p, - ParagraphList::const_iterator const & pend) + ParagraphList::const_iterator p, + ParagraphList::const_iterator const & pend) { Layout const & bstyle = p->layout(); size_t const depth = p->params().depth(); @@ -95,12 +94,13 @@ ParagraphList::const_iterator searchEnvironment( } -ParagraphList::const_iterator makeParagraph(Buffer const & buf, - odocstream & os, - OutputParams const & runparams, - Text const & text, - ParagraphList::const_iterator const & pbegin, - ParagraphList::const_iterator const & pend) +ParagraphList::const_iterator makeParagraph( + Buffer const & buf, + odocstream & os, + OutputParams const & runparams, + Text const & text, + ParagraphList::const_iterator const & pbegin, + ParagraphList::const_iterator const & pend) { ParagraphList const & paragraphs = text.paragraphs(); for (ParagraphList::const_iterator par = pbegin; par != pend; ++par) { @@ -123,12 +123,13 @@ ParagraphList::const_iterator makeParagraph(Buffer const & buf, } -ParagraphList::const_iterator makeEnvironment(Buffer const & buf, - odocstream & os, - OutputParams const & runparams, - Text const & text, - ParagraphList::const_iterator const & pbegin, - ParagraphList::const_iterator const & pend) +ParagraphList::const_iterator makeEnvironment( + Buffer const & buf, + odocstream & os, + OutputParams const & runparams, + Text const & text, + ParagraphList::const_iterator const & pbegin, + ParagraphList::const_iterator const & pend) { ParagraphList const & paragraphs = text.paragraphs(); ParagraphList::const_iterator par = pbegin; @@ -244,12 +245,13 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, } -ParagraphList::const_iterator makeCommand(Buffer const & buf, - odocstream & os, - OutputParams const & runparams, - Text const & text, - ParagraphList::const_iterator const & pbegin, - ParagraphList::const_iterator const & pend) +ParagraphList::const_iterator makeCommand( + Buffer const & buf, + odocstream & os, + OutputParams const & runparams, + Text const & text, + ParagraphList::const_iterator const & pbegin, + ParagraphList::const_iterator const & pend) { ParagraphList const & paragraphs = text.paragraphs(); ParagraphList::const_iterator par = pbegin; @@ -295,7 +297,11 @@ ParagraphList::const_iterator makeCommand(Buffer const & buf, send = searchParagraph(par, pend); par = makeParagraph(buf, os, runparams, text, par,send); break; - default: + case LATEX_BIB_ENVIRONMENT: + case LATEX_LIST_ENVIRONMENT: + // FIXME This means that we are just skipping any paragraph that + // isn't implemented above. + ++par; break; } } @@ -313,15 +319,17 @@ void docbookParagraphs(Text const & text, odocstream & os, OutputParams const & runparams) { + LASSERT(runparams.par_begin <= runparams.par_end, + { os << "\n"; return; }); + ParagraphList const & paragraphs = text.paragraphs(); ParagraphList::const_iterator par = paragraphs.begin(); ParagraphList::const_iterator pend = paragraphs.end(); - LASSERT(runparams.par_begin <= runparams.par_end, /**/); // if only part of the paragraphs will be outputed if (runparams.par_begin != runparams.par_end) { - par = boost::next(paragraphs.begin(), runparams.par_begin); - pend = boost::next(paragraphs.begin(), runparams.par_end); + par = next(paragraphs.begin(), runparams.par_begin); + pend = next(paragraphs.begin(), runparams.par_end); // runparams will be passed to nested paragraphs, so // we have to reset the range parameters. const_cast(runparams).par_begin = 0; @@ -349,7 +357,11 @@ void docbookParagraphs(Text const & text, send = searchParagraph(par, pend); par = makeParagraph(buf, os, runparams, text, par, send); break; - default: + case LATEX_BIB_ENVIRONMENT: + case LATEX_LIST_ENVIRONMENT: + // FIXME This means that we are just skipping any paragraph that + // isn't implemented above. + ++par; break; } // makeEnvironment may process more than one paragraphs and bypass pend