]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph_pimpl.C
mathed uglyfication
[lyx.git] / src / paragraph_pimpl.C
index 8cec598fd3e144875658b910d7cd13ef6a88f8eb..91d67776610bbff0ca207c5353890633543ae561 100644 (file)
 #include "encoding.h"
 #include "language.h"
 #include "LaTeXFeatures.h"
-#include "latexrunparams.h"
 #include "LColor.h"
 #include "lyxlength.h"
 #include "lyxrc.h"
+#include "outputparams.h"
 #include "texrow.h"
 
 
@@ -31,6 +31,7 @@ using lyx::pos_type;
 
 using std::endl;
 using std::upper_bound;
+using std::lower_bound;
 using std::string;
 using std::ostream;
 
@@ -361,8 +362,7 @@ bool Paragraph::Pimpl::erase(pos_type pos)
                // only allow the actual removal if it was /new/ text
                if (changetype != Change::INSERTED) {
                        if (owner_->text_[pos] == Paragraph::META_INSET) {
-                               InsetOld * i(owner_->getInset(pos));
-                               i->markErased();
+                               owner_->getInset(pos)->markErased();
                        }
                        return false;
                }
@@ -376,12 +376,9 @@ bool Paragraph::Pimpl::erase(pos_type pos)
 int Paragraph::Pimpl::erase(pos_type start, pos_type end)
 {
        pos_type i = start;
-       pos_type count = end - start;
-       while (count) {
-               if (!erase(i)) {
+       for (pos_type count = end - start; count; --count) {
+               if (!erase(i))
                        ++i;
-               }
-               --count;
        }
        return end - i;
 }
@@ -453,7 +450,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                                             BufferParams const & bparams,
                                             ostream & os,
                                             TexRow & texrow,
-                                            LatexRunParams const & runparams,
+                                            OutputParams const & runparams,
                                             LyXFont & font,
                                             LyXFont & running_font,
                                             LyXFont & basefont,
@@ -471,7 +468,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                                os << c;
                } else {
                        InsetOld const * inset = owner_->getInset(i);
-                       inset->ascii(buf, os, 0);
+                       inset->plaintext(buf, os, runparams);
                }
                return;
        }
@@ -522,8 +519,8 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                }
 
                bool close = false;
-               int const len = os.tellp();
-               //ostream::pos_type const len = os.tellp();
+               ostream::pos_type const len = os.tellp();
+
                if ((inset->lyxCode() == InsetOld::GRAPHICS_CODE
                     || inset->lyxCode() == InsetOld::MATH_CODE
                     || inset->lyxCode() == InsetOld::URL_CODE)
@@ -561,7 +558,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                        texrow.start(owner_->id(), i + 1);
                        column = 0;
                } else {
-                       column += int(os.tellp()) - len;
+                       column += os.tellp() - len;
                }
        }
        break;
@@ -735,8 +732,6 @@ void Paragraph::Pimpl::validate(LaTeXFeatures & features,
        BufferParams const & bparams = features.bufferParams();
 
        // check the params.
-       if (params.lineTop() || params.lineBottom())
-               features.require("lyxline");
        if (!params.spacing().isDefault())
                features.require("setspace");