#include "lyxrow.h"
#include "messages.h"
#include "outputparams.h"
+#include "output_latex.h"
#include "paragraph_funcs.h"
#include "rowpainter.h"
odocstream & os, TexRow & texrow,
OutputParams const & runparams) const
{
- lyxerr[Debug::LATEX] << "SimpleTeXOnePar... " << this << endl;
+ LYXERR(Debug::LATEX) << "SimpleTeXOnePar... " << this << endl;
bool return_value = false;
// As long as we are in the label, this font is the base font of the
// label. Before the first body character it is set to the base font
// of the body.
- // This must be identical to basefont in TeXOnePar().
LyXFont basefont;
// output change tracking marks only if desired,
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) {
if (body_pos > 0) {
if (open_font) {
column += running_font.latexWriteEndChanges(
- os, basefont, basefont, bparams);
+ os, basefont, basefont);
open_font = false;
}
basefont = getLayoutFont(bparams, outerfont);
changeType, output);
runningChangeType = changeType;
- value_type c = getChar(i);
+ value_type const c = getChar(i);
// Fully instantiated font
- LyXFont font = getFont(bparams, i, outerfont);
+ LyXFont const font = getFont(bparams, i, outerfont);
LyXFont const last_font = running_font;
{
column += running_font.latexWriteEndChanges(
os, basefont,
- (i == body_pos-1) ? basefont : font,
- bparams);
+ (i == body_pos-1) ? basefont : font);
running_font = basefont;
open_font = false;
}
+ // Switch file encoding if necessary
+ int const count = switchEncoding(os, bparams,
+ runparams.moving_arg, *(runparams.encoding),
+ *(font.language()->encoding()));
+ if (count > 0) {
+ column += count;
+ runparams.encoding = font.language()->encoding();
+ }
+
// Do we need to change font?
if ((font != running_font ||
font.language() != running_font.language()) &&
i != body_pos - 1)
{
- column += font.latexWriteStartChanges(
- os, basefont, last_font, bparams);
+ column += font.latexWriteStartChanges(os, basefont,
+ last_font);
running_font = font;
open_font = true;
}
// 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
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);
if (next_) {
running_font
.latexWriteEndChanges(os, basefont,
- next_->getFont(bparams, 0, outerfont),
- bparams);
+ next_->getFont(bparams, 0, outerfont));
} else {
running_font.latexWriteEndChanges(os, basefont,
- basefont, bparams);
+ basefont);
}
#else
#ifdef WITH_WARNINGS
//#warning there as we start another \selectlanguage with the next paragraph if
//#warning we are in need of this. This should be fixed sometime (Jug)
#endif
- running_font.latexWriteEndChanges(os, basefont, basefont,
- bparams);
+ running_font.latexWriteEndChanges(os, basefont, basefont);
#endif
}
runparams.moving_arg);
}
- lyxerr[Debug::LATEX] << "SimpleTeXOnePar...done " << this << endl;
+ LYXERR(Debug::LATEX) << "SimpleTeXOnePar...done " << this << endl;
return return_value;
}
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 = ' ';