]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
Fix loop when opening TOC widget in an empty document, basically by Richard Heck.
[lyx.git] / src / paragraph.C
index f95d48d1a22f4cba54b6ab67da3aac1822b2603d..05b480c2b519966c0551b13d03c3d235f3ca4053 100644 (file)
@@ -939,7 +939,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                                odocstream & os, TexRow & texrow,
                                OutputParams const & runparams) const
 {
-       lyxerr[Debug::LATEX] << "SimpleTeXOnePar...     " << this << endl;
+       LYXERR(Debug::LATEX) << "SimpleTeXOnePar...     " << this << endl;
 
        bool return_value = false;
 
@@ -1007,9 +1007,6 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                                                    runparams.moving_arg);
        }
 
-       // Computed only once per paragraph since bparams.encoding() is expensive
-       Encoding const & doc_encoding = bparams.encoding();
-
        for (pos_type i = 0; i < size(); ++i) {
                // First char in paragraph or after label?
                if (i == body_pos) {
@@ -1076,7 +1073,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
 
                // Switch file encoding if necessary
                int const count = switchEncoding(os, bparams,
-                               *(runparams.encoding),
+                               runparams.moving_arg, *(runparams.encoding),
                                *(font.language()->encoding()));
                if (count > 0) {
                        column += count;
@@ -1100,8 +1097,8 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                        // simpleTeXSpecialChars ignores spaces if
                        // style->pass_thru is false.
                        if (i != body_pos - 1) {
-                               if (pimpl_->simpleTeXBlanks(bparams,
-                                               doc_encoding, os, texrow,
+                               if (pimpl_->simpleTeXBlanks(
+                                               *(runparams.encoding), os, texrow,
                                                i, column, font, *style))
                                        // A surrogate pair was output. We
                                        // must not call simpleTeXSpecialChars
@@ -1117,7 +1114,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                rp.free_spacing = style->free_spacing;
                rp.local_font = &font;
                rp.intitle = style->intitle;
-               pimpl_->simpleTeXSpecialChars(buf, bparams, doc_encoding, os,
+               pimpl_->simpleTeXSpecialChars(buf, bparams, os,
                                        texrow, rp, running_font,
                                        basefont, outerfont, open_font,
                                        runningChangeType, *style, i, column, c);
@@ -1158,7 +1155,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                                          runparams.moving_arg);
        }
 
-       lyxerr[Debug::LATEX] << "SimpleTeXOnePar...done " << this << endl;
+       LYXERR(Debug::LATEX) << "SimpleTeXOnePar...done " << this << endl;
        return return_value;
 }
 
@@ -1557,11 +1554,7 @@ bool Paragraph::allowEmpty() const
 char_type Paragraph::transformChar(char_type c, pos_type pos) const
 {
        if (!Encodings::is_arabic(c))
-               if (lyxrc.font_norm_type == LyXRC::ISO_8859_6_8 && isDigit(c))
-                       // FIXME UNICODE What does this do?
-                       return c + (0xb0 - '0');
-               else
-                       return c;
+               return c;
 
        value_type const prev_char = pos > 0 ? getChar(pos - 1) : ' ';
        value_type next_char = ' ';