]> git.lyx.org Git - lyx.git/blobdiff - src/output_linuxdoc.C
* remove various xforms relicts, in particular:
[lyx.git] / src / output_linuxdoc.C
index 7db9ab81cba3238d03cb6bef0d1fccd94fc58b27..459c23b324de132f7452ee731d7f5e6f77d655a7 100644 (file)
 
 #include "buffer.h"
 #include "bufferparams.h"
+#include "outputparams.h"
 #include "paragraph.h"
 #include "paragraph_funcs.h"
-#include "ParagraphList_fwd.h"
+#include "ParagraphList.h"
 #include "ParagraphParameters.h"
 #include "sgml.h"
 
@@ -40,6 +41,18 @@ void linuxdocParagraphs(Buffer const & buf,
 
        ParagraphList::const_iterator pit = paragraphs.begin();
        ParagraphList::const_iterator pend = paragraphs.end();
+       
+       BOOST_ASSERT(runparams.par_begin <= runparams.par_end);
+       // if only part of the paragraphs will be outputed
+       if (runparams.par_begin !=  runparams.par_end) {
+               pit = boost::next(paragraphs.begin(), runparams.par_begin);
+               pend = boost::next(paragraphs.begin(), runparams.par_end);
+               // runparams will be passed to nested paragraphs, so
+               // we have to reset the range parameters.
+               const_cast<OutputParams&>(runparams).par_begin = 0;
+               const_cast<OutputParams&>(runparams).par_end = 0;
+       }
+
        for (; pit != pend; ++pit) {
                LyXLayout_ptr const & style = pit->layout();
                // treat <toc> as a special case for compatibility with old code
@@ -133,7 +146,7 @@ void linuxdocParagraphs(Buffer const & buf,
                }
 
                pit->simpleLinuxDocOnePar(buf, os,
-                       outerFont(pit - paragraphs.begin(), paragraphs),
+                                         outerFont(std::distance(paragraphs.begin(), pit), paragraphs),
                                          runparams, depth);
 
                os << "\n";