From d5f03d0c6eac8a3c485e88ee629554fa1dc9cb0d Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Tue, 13 Mar 2007 19:46:56 +0000 Subject: [PATCH] * src/paragraph_pimpl.[Ch] (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 | 2 +- src/paragraph_pimpl.C | 21 +++++++++++---------- src/paragraph_pimpl.h | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/paragraph.C b/src/paragraph.C index 71b6b7f4e7..6de1977d3a 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -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); } diff --git a/src/paragraph_pimpl.C b/src/paragraph_pimpl.C index 900837a49a..1d3fd5a57a 100644 --- a/src/paragraph_pimpl.C +++ b/src/paragraph_pimpl.C @@ -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)) { diff --git a/src/paragraph_pimpl.h b/src/paragraph_pimpl.h index 3b8e0b0fab..df899b695d 100644 --- a/src/paragraph_pimpl.h +++ b/src/paragraph_pimpl.h @@ -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, -- 2.39.2