X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxfont.C;h=9d0d7c911cb9d6f8edda686b9bcbf55b52af8a60;hb=35cf7dcb2bdfdcda465b69c58465f657c77fd9d7;hp=82d4062bb8b675709e6992b7caed160c0366148c;hpb=e059c633b01937f450ff9fa873cfc6b773aa74cc;p=lyx.git diff --git a/src/lyxfont.C b/src/lyxfont.C index 82d4062bb8..9d0d7c911c 100644 --- a/src/lyxfont.C +++ b/src/lyxfont.C @@ -24,6 +24,7 @@ #include "lyxlex.h" #include "FontLoader.h" #include "support/lstrings.h" +#include "bufferparams.h" // stateText using std::ostream; using std::endl; @@ -380,7 +381,7 @@ bool LyXFont::resolved() const /// Build GUI description of font state -string LyXFont::stateText() const +string LyXFont::stateText(BufferParams * params) const { #ifdef HAVE_SSTREAM std::ostringstream ost; @@ -410,7 +411,8 @@ string LyXFont::stateText() const ost << _("Latex ") << _(GUIMiscNames[latex()]) << ", "; if (bits == inherit) ost << _("Default") << ", "; - ost << _("Language: ") << _(language()->display.c_str()); + if (!params || language() != params->language_info) + ost << _("Language: ") << _(language()->display().c_str()); #ifdef HAVE_SSTREAM string buf(ost.str().c_str()); #else @@ -655,11 +657,16 @@ void LyXFont::lyxWriteChanges(LyXFont const & orgfont, ostream & os) const } } if (orgfont.color() != color()) { - os << "\\color " << lcolor.getLyXName(color()) << "\n"; + // To make us file compatible with older + // lyx versions we emit "default" instead + // of "inherit" + string col_str(lcolor.getLyXName(color())); + if (col_str == "inherit") col_str = "default"; + os << "\\color " << col_str << "\n"; } if (orgfont.language() != language()) { if (language()) - os << "\\lang " << language()->lang << "\n"; + os << "\\lang " << language()->lang() << "\n"; else os << "\\lang unknown\n"; } @@ -688,7 +695,7 @@ int LyXFont::latexWriteStartChanges(ostream & os, LyXFont const & base, } else { string tmp = '{' + subst(lyxrc.language_command_begin, - "$$lang", language()->lang); + "$$lang", language()->lang()); os << tmp; count += tmp.length(); env = true; //We have opened a new environment