* 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
This commit is contained in:
Georg Baum 2007-03-13 19:46:56 +00:00
parent 57a68063ad
commit d5f03d0c6e
3 changed files with 13 additions and 12 deletions

View File

@ -1106,7 +1106,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
rp.local_font = &font; rp.local_font = &font;
rp.intitle = style->intitle; rp.intitle = style->intitle;
pimpl_->simpleTeXSpecialChars(buf, bparams, doc_encoding, os, pimpl_->simpleTeXSpecialChars(buf, bparams, doc_encoding, os,
texrow, rp, font, running_font, texrow, rp, running_font,
basefont, outerfont, open_font, basefont, outerfont, open_font,
runningChangeType, *style, i, column, c); runningChangeType, *style, i, column, c);
} }

View File

@ -482,7 +482,6 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
odocstream & os, odocstream & os,
TexRow & texrow, TexRow & texrow,
OutputParams const & runparams, OutputParams const & runparams,
LyXFont & font,
LyXFont & running_font, LyXFont & running_font,
LyXFont & basefont, LyXFont & basefont,
LyXFont const & outerfont, LyXFont const & outerfont,
@ -527,12 +526,13 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
os, basefont, basefont, bparams); os, basefont, basefont, bparams);
open_font = false; open_font = false;
} }
if (running_font.family() == LyXFont::TYPEWRITER_FAMILY)
os << '~';
basefont = owner_->getLayoutFont(bparams, outerfont); basefont = owner_->getLayoutFont(bparams, outerfont);
running_font = basefont; running_font = basefont;
if (font.family() == LyXFont::TYPEWRITER_FAMILY)
os << '~';
if (runparams.moving_arg) if (runparams.moving_arg)
os << "\\protect "; os << "\\protect ";
@ -634,7 +634,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
break; break;
} }
// Typewriter font also has them // Typewriter font also has them
if (font.family() == LyXFont::TYPEWRITER_FAMILY) { if (running_font.family() == LyXFont::TYPEWRITER_FAMILY) {
os.put(c); os.put(c);
break; break;
} }
@ -657,9 +657,9 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
break; break;
case '-': // "--" in Typewriter mode -> "-{}-" case '-': // "--" in Typewriter mode -> "-{}-"
if (i <= size() - 2 if (i <= size() - 2 &&
&& getChar(i + 1) == '-' getChar(i + 1) == '-' &&
&& font.family() == LyXFont::TYPEWRITER_FAMILY) { running_font.family() == LyXFont::TYPEWRITER_FAMILY) {
os << "-{}"; os << "-{}";
column += 2; column += 2;
} else { } else {
@ -711,7 +711,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
// I assume this is hack treating typewriter as verbatim // I assume this is hack treating typewriter as verbatim
// FIXME UNICODE: This can fail if c cannot be encoded // FIXME UNICODE: This can fail if c cannot be encoded
// in the current encoding. // in the current encoding.
if (font.family() == LyXFont::TYPEWRITER_FAMILY) { if (running_font.family() == LyXFont::TYPEWRITER_FAMILY) {
if (c != '\0') { if (c != '\0') {
os.put(c); os.put(c);
} }
@ -738,7 +738,8 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
} }
if (pnr == phrases_nr && c != '\0') { 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) { if (i < size() - 1) {
char_type next = getChar(i + 1); char_type next = getChar(i + 1);
if (Encodings::isCombiningChar(next)) { if (Encodings::isCombiningChar(next)) {

View File

@ -141,7 +141,7 @@ public:
void simpleTeXSpecialChars(Buffer const &, BufferParams const &, void simpleTeXSpecialChars(Buffer const &, BufferParams const &,
Encoding const &, odocstream &, Encoding const &, odocstream &,
TexRow & texrow, OutputParams const &, TexRow & texrow, OutputParams const &,
LyXFont & font, LyXFont & running_font, LyXFont & running_font,
LyXFont & basefont, LyXFont & basefont,
LyXFont const & outerfont, LyXFont const & outerfont,
bool & open_font, bool & open_font,