]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
speedup latex export a lot
[lyx.git] / src / paragraph.C
index ede6729f7404f691a7b0850ec66b6cbb4adb116e..1a6cdfc35a5a61713500709dde8b7fd92b9414e3 100644 (file)
@@ -41,7 +41,6 @@
 #include "insets/insetoptarg.h"
 
 #include "support/lstrings.h"
-#include "support/std_sstream.h"
 #include "support/textutils.h"
 #include "support/tostr.h"
 
@@ -50,6 +49,7 @@
 
 #include <list>
 #include <stack>
+#include <sstream>
 
 using lyx::pos_type;
 
@@ -784,7 +784,7 @@ int Paragraph::startTeXParParams(BufferParams const & bparams,
        case LYX_ALIGN_CENTER:
                if (moving_arg) {
                        os << "\\protect";
-                       column = 8;
+                       column += 8;
                }
                break;
        }
@@ -890,7 +890,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                                BufferParams const & bparams,
                                LyXFont const & outerfont,
                                ostream & os, TexRow & texrow,
-                               OutputParams const & runparams)
+                               OutputParams const & runparams) const
 {
        lyxerr[Debug::LATEX] << "SimpleTeXOnePar...     " << this << endl;
 
@@ -924,8 +924,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                basefont = getLayoutFont(bparams, outerfont);
        }
 
-       bool moving_arg = runparams.moving_arg;
-       moving_arg |= style->needprotect;
+       bool const moving_arg = runparams.moving_arg | style->needprotect;
 
        // Which font is currently active?
        LyXFont running_font(basefont);
@@ -1027,8 +1026,10 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                OutputParams rp = runparams;
                rp.moving_arg = moving_arg;
                rp.free_spacing = style->free_spacing;
+               rp.lang = font.language()->babel();
+               rp.intitle = style->intitle;
                pimpl_->simpleTeXSpecialChars(buf, bparams,
-                                             os, texrow, runparams,
+                                             os, texrow, rp,
                                              font, running_font,
                                              basefont, outerfont, open_font,
                                              running_change,
@@ -1524,7 +1525,9 @@ bool Paragraph::isLetter(pos_type pos) const
 
 bool Paragraph::isWord(pos_type pos) const
 {
-       unsigned char const c = getChar(pos);
+       if (isInset(pos))
+               return getInset(pos)->isLetter();
+       value_type const c = getChar(pos);
        return !(IsSeparatorChar(c)
                  || IsKommaChar(c)
                  || IsInsetChar(c));