} else {
if (open_font) {
column += running_font.latexWriteEndChanges(
- os, basefont, basefont);
+ os, bparams, runparams,
+ basefont, basefont);
open_font = false;
}
// some insets cannot be inside a font change command
if (open_font && inset->noFontChange()) {
column += running_font.latexWriteEndChanges(
- os, basefont, basefont);
+ os, bparams, runparams,
+ basefont, basefont);
open_font = false;
basefont = owner_->getLayoutFont(bparams, outerfont);
running_font = basefont;
{
features.useLanguage(language);
LYXERR(Debug::LATEX) << "Found language "
- << language->babel() << endl;
+ << language->lang() << endl;
}
}
// Gets the fully instantiated font at a given position in a paragraph
-// This is basically the same function as LyXText::GetFont() in text2.cpp.
+// This is basically the same function as Text::GetFont() in text2.cpp.
// The difference is that this one is used for generating the LaTeX file,
// and thus cosmetic "improvements" are disallowed: This has to deliver
// the true picture of the buffer. (Asger)
docstring Paragraph::expandLabel(Layout_ptr const & layout,
BufferParams const & bparams, bool process_appendix) const
{
- LyXTextClass const & tclass = bparams.getLyXTextClass();
+ TextClass const & tclass = bparams.getTextClass();
docstring fmt;
if (process_appendix && params().appendix())
bool asdefault = forceDefaultParagraphs();
if (asdefault) {
- style = bparams.getLyXTextClass().defaultLayout();
+ style = bparams.getTextClass().defaultLayout();
} else {
style = layout();
}
if (body_pos > 0) {
if (open_font) {
column += running_font.latexWriteEndChanges(
- os, basefont, basefont);
+ os, bparams, runparams,
+ basefont, basefont);
open_font = false;
}
basefont = getLayoutFont(bparams, outerfont);
font.language() != running_font.language()))
{
column += running_font.latexWriteEndChanges(
- os, basefont,
+ os, bparams, runparams, basefont,
(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();
+ if (runparams.encoding->package() == Encoding::inputenc &&
+ font.language()->encoding()->package() == Encoding::inputenc) {
+ 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?
font.language() != running_font.language()) &&
i != body_pos - 1)
{
- column += font.latexWriteStartChanges(os, basefont,
+ column += font.latexWriteStartChanges(os, bparams,
+ runparams, basefont,
last_font);
running_font = font;
open_font = true;
#ifdef FIXED_LANGUAGE_END_DETECTION
if (next_) {
running_font
- .latexWriteEndChanges(os, basefont,
+ .latexWriteEndChanges(os, bparams, runparams,
+ basefont,
next_->getFont(bparams, 0, outerfont));
} else {
- running_font.latexWriteEndChanges(os, basefont,
- basefont);
+ running_font.latexWriteEndChanges(os, bparams,
+ runparams, basefont, 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);
+ running_font.latexWriteEndChanges(os, bparams, runparams,
+ basefont, basefont);
#endif
}