]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfont.C
NEW_INSETS changes, + some small things in insettabular.C
[lyx.git] / src / lyxfont.C
index 82d4062bb8b675709e6992b7caed160c0366148c..9d0d7c911cb9d6f8edda686b9bcbf55b52af8a60 100644 (file)
@@ -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