]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
The "I want this in now" patch.
[lyx.git] / src / paragraph.C
index d4f19258b3d44582770eff9080c522b59454ad8d..06cc0b128221cefae0c45733057b71769af67526 100644 (file)
 
 #include "paragraph.h"
 #include "paragraph_pimpl.h"
-#include "lyxrc.h"
-#include "layout.h"
-#include "language.h"
+
 #include "buffer.h"
 #include "bufferparams.h"
-#include "debug.h"
-#include "texrow.h"
 #include "BufferView.h"
+#include "changes.h"
 #include "encoding.h"
-#include "ParameterStruct.h"
+#include "debug.h"
 #include "gettext.h"
-#include "changes.h"
+#include "language.h"
+#include "latexrunparams.h"
+#include "layout.h"
+#include "lyxrc.h"
 #include "paragraph_funcs.h"
+#include "ParameterStruct.h"
+#include "texrow.h"
+
 #include "Lsstream.h"
 
 #include "insets/insetbibitem.h"
@@ -73,6 +76,9 @@ Paragraph::Paragraph()
 #ifndef NO_NEXT
        next_ = 0;
        previous_ = 0;
+#else
+       next_par_ = 0;
+       prev_par_ = 0;
 #endif
        enumdepth = 0;
        itemdepth = 0;
@@ -80,28 +86,6 @@ Paragraph::Paragraph()
 }
 
 
-#ifndef NO_NEXT
-// This constructor inserts the new paragraph in a list.
-// It is placed after par.
-Paragraph::Paragraph(Paragraph * par)
-       : pimpl_(new Paragraph::Pimpl(this))
-{
-       enumdepth = 0;
-       itemdepth = 0;
-
-       // double linked list begin
-       next_ = par->next_;
-       if (next_)
-               next_->previous_ = this;
-       previous_ = par;
-       previous_->next_ = this;
-       // end
-
-       params().clear();
-}
-#endif
-
-
 Paragraph::Paragraph(Paragraph const & lp, bool same_ids)
        : pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this, same_ids))
 {
@@ -110,6 +94,9 @@ Paragraph::Paragraph(Paragraph const & lp, bool same_ids)
 #ifndef NO_NEXT
        next_     = 0;
        previous_ = 0;
+#else
+       next_par_ = 0;
+       prev_par_ = 0;
 #endif
        // this is because of the dummy layout of the paragraphs that
        // follow footnotes
@@ -928,6 +915,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
                                BufferParams const & bparams,
                                LyXFont const & outerfont,
                                ostream & os, TexRow & texrow,
+                               LatexRunParams const & runparams,
                                bool moving_arg)
 {
        lyxerr[Debug::LATEX] << "SimpleTeXOnePar...     " << this << endl;
@@ -1073,8 +1061,10 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
                column += Changes::latexMarkChange(os, running_change, change);
                running_change = change;
 
+               LatexRunParams rp = runparams;
+               rp.fragile = moving_arg;
                pimpl_->simpleTeXSpecialChars(buf, bparams,
-                                             os, texrow, moving_arg,
+                                             os, texrow, runparams,
                                              font, running_font,
                                              basefont, outerfont, open_font,
                                              running_change,
@@ -1407,7 +1397,7 @@ int Paragraph::id() const
 LyXLayout_ptr const & Paragraph::layout() const
 {
        Inset * inset = inInset();
-       if (inset && inset->lyxCode() == Inset::ENVIRONMENT_CODE) 
+       if (inset && inset->lyxCode() == Inset::ENVIRONMENT_CODE)
                return static_cast<InsetEnvironment*>(inset)->layout();
        return layout_;
 }