// Write font changes
LyXFont font2 = getFontSettings(bparams, i);
if (font2 != font1) {
+#ifndef INHERIT_LANGUAGE
+ font2.lyxWriteChanges(font1, os);
+#else
font2.lyxWriteChanges(font1, bparams.language, os);
+#endif
column = 0;
font1 = font2;
}
}
Language const * language = cit->font().language();
- if (language != ignore_language &&
- language != inherit_language &&
- language->babel() != doc_language->babel())
+ if (language->babel() != doc_language->babel() &&
+ language != ignore_language &&
+#ifdef INHERIT_LANGUAGE
+ language != inherit_language &&
+#endif
+ language != latex_language)
{
features.UsedLanguages.insert(language);
lyxerr[Debug::LATEX] << "Found language "
}
// then the insets
+ LyXLayout const & layout =
+ textclasslist.Style(bparams.textclass,
+ getLayout());
+
for (InsetList::const_iterator cit = insetlist.begin();
cit != insetlist.end(); ++cit) {
- if (cit->inset)
+ if (cit->inset) {
cit->inset->validate(features);
+ if (layout.needprotect &&
+ cit->inset->lyxCode() == Inset::FOOT_CODE)
+ features.NeedLyXFootnoteCode = true;
+ }
}
}
}
-void Paragraph::insertChar(Paragraph::size_type pos,
- Paragraph::value_type c)
+void Paragraph::insertChar(Paragraph::size_type pos, Paragraph::value_type c)
{
LyXFont const f(LyXFont::ALL_INHERIT);
insertChar(pos, c, f);
}
-void Paragraph::insertChar(Paragraph::size_type pos,
- Paragraph::value_type c,
- LyXFont const & font)
+void Paragraph::insertChar(Paragraph::size_type pos, Paragraph::value_type c,
+ LyXFont const & font)
{
pimpl_->insertChar(pos, c, font);
}
-void Paragraph::insertInset(Paragraph::size_type pos,
- Inset * inset)
+void Paragraph::insertInset(Paragraph::size_type pos, Inset * inset)
{
LyXFont const f(LyXFont::ALL_INHERIT);
insertInset(pos, inset, f);
}
-void Paragraph::insertInset(Paragraph::size_type pos,
- Inset * inset, LyXFont const & font)
+void Paragraph::insertInset(Paragraph::size_type pos, Inset * inset,
+ LyXFont const & font)
{
pimpl_->insertInset(pos, inset, font);
}
if (it != insetlist.end() && it->pos == pos)
return it->inset;
- lyxerr << "ERROR (Paragraph::GetInset): "
+ lyxerr << "ERROR (Paragraph::getInset): "
"Inset does not exist: " << pos << endl;
//::raise(SIGSTOP);
retfont = getFontSettings(bparams, pos - 1);
} else
retfont = LyXFont(LyXFont::ALL_INHERIT, getParLanguage(bparams));
+#ifdef INHERIT_LANGUAGE
if (retfont.language() == inherit_language)
retfont.setLanguage(bparams.language);
+#endif
return retfont;
}
layoutfont = layout.font;
LyXFont tmpfont = getFontSettings(bparams, pos);
+#ifndef INHERIT_LANGUAGE
+ tmpfont.realize(layoutfont);
+#else
tmpfont.realize(layoutfont, bparams.language);
+#endif
return pimpl_->realizeFont(tmpfont, bparams);
}
Language const * doc_language = bparams.language;
Language const * previous_language = previous_
? previous_->getParLanguage(bparams) : doc_language;
- if (language == ignore_language || language == inherit_language)
- lyxerr << "1:" << language->lang() << endl;
if (language->babel() != doc_language->babel() &&
language->babel() != previous_language->babel()) {
os << subst(lyxrc.language_command_begin, "$$lang",
}
#else
#ifdef WITH_WARNINGS
-#warning For now we ALWAYS have to close the foreign font settings if they are
-#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)
+//#warning For now we ALWAYS have to close the foreign font settings if they are
+//#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);
#endif
Paragraph::getParLanguage(BufferParams const & bparams) const
{
if (size() > 0) {
+#ifndef INHERIT_LANGUAGE
+ return getFirstFontSettings().language();
+#else
Language const * lang = getFirstFontSettings().language();
#warning We should make this somewhat better, any ideas? (Jug)
if (lang == inherit_language || lang == ignore_language)
lang = bparams.language;
return lang;
+#endif
} else if (previous_)
return previous_->getParLanguage(bparams);
else
Language const * doc_language = bparams.language;
for (Pimpl::FontList::const_iterator cit = pimpl_->fontlist.begin();
cit != pimpl_->fontlist.end(); ++cit)
- if (cit->font().language() != inherit_language &&
- cit->font().language() != ignore_language &&
+ if (cit->font().language() != ignore_language &&
+ cit->font().language() != latex_language &&
+#ifdef INHERIT_LANGUAGE
+ cit->font().language() != inherit_language &&
+#endif
cit->font().language() != doc_language)
return true;
return false;
string const Paragraph::asString(Buffer const * buffer,
- Paragraph::size_type beg,
- Paragraph::size_type end)
+ Paragraph::size_type beg,
+ Paragraph::size_type end,
+ bool label)
{
ostringstream ost;
- if (beg == 0 && !params().labelString().empty())
+ if (beg == 0 && label && !params().labelString().empty())
ost << params().labelString() << ' ';
for (Paragraph::size_type i = beg; i < end; ++i) {
value_type const c = getUChar(buffer->params, i);
if (IsPrintable(c))
ost << c;
+ else if (c == META_NEWLINE)
+ ost << '\n';
+ else if (c == META_HFILL)
+ ost << '\t';
else if (c == META_INSET) {
getInset(i)->ascii(buffer, ost);
}
{
// then the insets
for (InsetList::const_iterator cit = insetlist.begin();
- cit != insetlist.end(); ++cit) {
+ cit != insetlist.end(); ++cit)
+ {
if (cit->inset) {
if (cit->inset->isTextInset()) {
static_cast<UpdatableInset *>