]> git.lyx.org Git - features.git/commitdiff
* src/paragraph_pimpl.[Ch]
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Tue, 13 Mar 2007 19:46:56 +0000 (19:46 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Tue, 13 Mar 2007 19:46:56 +0000 (19:46 +0000)
(Paragraph::Pimpl::simpleTeXSpecialChars): Get rid of the 'font'
argument, since the caller ensures that it is equal to 'running_font'.

* src/paragraph.C
(Paragraph::simpleTeXOnePar): Adjust to change above

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17437 a592a061-630c-0410-9148-cb99ea01b6c8

src/paragraph.C
src/paragraph_pimpl.C
src/paragraph_pimpl.h

index 71b6b7f4e7b4316754a43c49637c500b45f0e8c3..6de1977d3ab00a9464e4dc71d4df80263a2d6d37 100644 (file)
@@ -1106,7 +1106,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                rp.local_font = &font;
                rp.intitle = style->intitle;
                pimpl_->simpleTeXSpecialChars(buf, bparams, doc_encoding, os,
-                                       texrow, rp, font, running_font,
+                                       texrow, rp, running_font,
                                        basefont, outerfont, open_font,
                                        runningChangeType, *style, i, column, c);
        }
index 900837a49a80d2c26e790ef0de5d81f4f2f965e5..1d3fd5a57a5e97a09d8b14e8120fc7a4bb47dfe5 100644 (file)
@@ -482,7 +482,6 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                                             odocstream & os,
                                             TexRow & texrow,
                                             OutputParams const & runparams,
-                                            LyXFont & font,
                                             LyXFont & running_font,
                                             LyXFont & basefont,
                                             LyXFont const & outerfont,
@@ -527,12 +526,13 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                                                os, basefont, basefont, bparams);
                                        open_font = false;
                                }
-                               basefont = owner_->getLayoutFont(bparams, outerfont);
-                               running_font = basefont;
 
-                               if (font.family() == LyXFont::TYPEWRITER_FAMILY)
+                               if (running_font.family() == LyXFont::TYPEWRITER_FAMILY)
                                        os << '~';
 
+                               basefont = owner_->getLayoutFont(bparams, outerfont);
+                               running_font = basefont;
+
                                if (runparams.moving_arg)
                                        os << "\\protect ";
 
@@ -634,7 +634,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                                break;
                        }
                        // Typewriter font also has them
-                       if (font.family() == LyXFont::TYPEWRITER_FAMILY) {
+                       if (running_font.family() == LyXFont::TYPEWRITER_FAMILY) {
                                os.put(c);
                                break;
                        }
@@ -657,9 +657,9 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                        break;
 
                case '-': // "--" in Typewriter mode -> "-{}-"
-                       if (i <= size() - 2
-                           && getChar(i + 1) == '-'
-                           && font.family() == LyXFont::TYPEWRITER_FAMILY) {
+                       if (i <= size() - 2 &&
+                           getChar(i + 1) == '-' &&
+                           running_font.family() == LyXFont::TYPEWRITER_FAMILY) {
                                os << "-{}";
                                column += 2;
                        } else {
@@ -711,7 +711,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                        // I assume this is hack treating typewriter as verbatim
                        // FIXME UNICODE: This can fail if c cannot be encoded
                        // in the current encoding.
-                       if (font.family() == LyXFont::TYPEWRITER_FAMILY) {
+                       if (running_font.family() == LyXFont::TYPEWRITER_FAMILY) {
                                if (c != '\0') {
                                        os.put(c);
                                }
@@ -738,7 +738,8 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                        }
 
                        if (pnr == phrases_nr && c != '\0') {
-                               Encoding const & encoding = getEncoding(bparams, doc_encoding, font);
+                               Encoding const & encoding =
+                                       getEncoding(bparams, doc_encoding, running_font);
                                if (i < size() - 1) {
                                        char_type next = getChar(i + 1);
                                        if (Encodings::isCombiningChar(next)) {
index 3b8e0b0fab6f61c497caa39f47298994a20b69a5..df899b695db235082778e9e99b41d4ebadd16959 100644 (file)
@@ -141,7 +141,7 @@ public:
        void simpleTeXSpecialChars(Buffer const &, BufferParams const &,
                                   Encoding const &, odocstream &,
                                   TexRow & texrow, OutputParams const &,
-                                  LyXFont & font, LyXFont & running_font,
+                                  LyXFont & running_font,
                                   LyXFont & basefont,
                                   LyXFont const & outerfont,
                                   bool & open_font,