X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Foutput_docbook.cpp;h=f453fc45b16b422aa5706a8ea64833a874a93c9a;hb=27f1f8a94857b147fcd5097351ec2fb070c2966e;hp=432b2e710903c2222ddbefd48b0f45a64591c58e;hpb=fa9bd04ea48bc7a3101bedcf8bab9b5e00d009bc;p=lyx.git diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp index 432b2e7109..f453fc45b1 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,19 +123,19 @@ 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; Layout const & defaultstyle = buf.params().documentClass().defaultLayout(); Layout const & bstyle = par->layout(); - string item_tag; // Opening outter tag sgml::openTag(buf, os, runparams, *pbegin); @@ -237,19 +237,20 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, if (bstyle.latextype == LATEX_ENVIRONMENT && bstyle.pass_thru) os << "]]>"; - // Closing outter tag + // Closing outer tag sgml::closeTag(os, *pbegin); return 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_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; @@ -317,15 +318,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 = lyx::next(paragraphs.begin(), runparams.par_begin); + pend = lyx::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;