]> git.lyx.org Git - lyx.git/blobdiff - src/Font.cpp
Add outline-in/out/up/down to the outline context menu.
[lyx.git] / src / Font.cpp
index 0a0408ea5abc64d312d0449b5cddc11fab9f3877..234314e05b7a00297b05a8116231d899fe08caf2 100644 (file)
@@ -3,10 +3,10 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  * \author Jean-Marc Lasgouttes
  * \author Angus Leeming
- * \author André Pönitz
+ * \author André Pönitz
  * \author Dekel Tsur
  *
  * Full author contact details are available in file CREDITS.
@@ -17,7 +17,7 @@
 #include "Font.h"
 
 #include "BufferParams.h" // stateText
-#include "Color.h"
+#include "ColorSet.h"
 #include "Encoding.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
@@ -26,7 +26,7 @@
 #include "output_latex.h"
 #include "OutputParams.h"
 
-#include "support/assert.h"
+#include "support/lassert.h"
 #include "support/convert.h"
 #include "support/debug.h"
 #include "support/gettext.h"
@@ -108,7 +108,7 @@ char const * LaTeXSizeNames[14] =
 
 
 Font::Font(FontInfo bits, Language const * l)
-       : bits_(bits), lang_(l), open_encoding_(false)
+       : bits_(bits), lang_(l), misspelled_(false), open_encoding_(false)
 {
        if (!lang_)
                lang_ = default_language;
@@ -146,6 +146,8 @@ void Font::update(Font const & newfont,
                        setLanguage(default_language);
                else
                        setLanguage(document_language);
+       else if (newfont.language() == reset_language)
+               setLanguage(document_language);
        else if (newfont.language() != ignore_language)
                setLanguage(newfont.language());
 }
@@ -642,9 +644,8 @@ int Font::latexWriteEndChanges(odocstream & os, BufferParams const & bparams,
 
 string Font::toString(bool const toggle) const
 {
-       string lang = "ignore";
-       if (language())
-               lang = language()->lang();
+       string const lang = (language() == reset_language)
+               ? "reset" : language()->lang();
 
        ostringstream os;
        os << "family " << bits_.family() << '\n'
@@ -720,10 +721,7 @@ bool Font::fromString(string const & data, bool & toggle)
 
                } else if (token == "language") {
                        string const next = lex.getString();
-                       if (next == "ignore")
-                               setLanguage(ignore_language);
-                       else
-                               setLanguage(languages.getLanguage(next));
+                       setLanguage(languages.getLanguage(next));
 
                } else if (token == "toggleall") {
                        toggle = lex.getBool();