X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxfont.C;h=9d0d7c911cb9d6f8edda686b9bcbf55b52af8a60;hb=35cf7dcb2bdfdcda465b69c58465f657c77fd9d7;hp=18be9a86a2fa042b97d827dcad08ec6dddb7deb9;hpb=c10a9001c85d63952f10b53978c265b4c29a237f;p=lyx.git diff --git a/src/lyxfont.C b/src/lyxfont.C index 18be9a86a2..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; @@ -408,13 +409,10 @@ string LyXFont::stateText() const ost << _("Noun ") << _(GUIMiscNames[noun()]) << ", "; if (latex() != INHERIT) ost << _("Latex ") << _(GUIMiscNames[latex()]) << ", "; - //if (buf.empty()) - // ost << _("Default"); - unsigned int opos = ost.tellp(); - //lyxerr << "Opos: " << opos << endl; - if (opos == 0) + 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 @@ -515,7 +513,7 @@ LyXFont & LyXFont::setLyXColor(string const & col) /// Sets size after GUI name LyXFont & LyXFont::setGUISize(string const & siz) { -#warning this might be wrong. + // CHECK this might be wrong. /// ?????? // this is how it was how it was done in the lyx repository... // but this does not make sense. @@ -659,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"; } @@ -692,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