* 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.
#include "Font.h"
#include "BufferParams.h" // stateText
-#include "Color.h"
+#include "ColorSet.h"
#include "Encoding.h"
#include "Language.h"
#include "LaTeXFeatures.h"
#include "output_latex.h"
#include "OutputParams.h"
+#include "support/lassert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/gettext.h"
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());
}
} else if (ttok == "noun") {
f.setNoun(FONT_ON);
} else {
- lex.printError("Illegal misc type `$$Token'");
+ lex.printError("Illegal misc type");
}
} else if (tok == "color") {
lex.next();
string const ttok = lex.getString();
setLyXColor(ttok, f);
} else {
- lex.printError("Unknown tag `$$Token'");
+ lex.printError("Unknown tag");
error = true;
}
}
if (open_encoding_) {
// We need to close the encoding even if it does not change
// to do correct environment nesting
- Encoding const * const ascii = encodings.getFromLyXName("ascii");
+ Encoding const * const ascii = encodings.fromLyXName("ascii");
pair<bool, int> const c = switchEncoding(os, bparams,
runparams, *ascii);
- BOOST_ASSERT(c.first);
+ LASSERT(c.first, /**/);
count += c.second;
runparams.encoding = ascii;
open_encoding_ = false;
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'
bool Font::fromString(string const & data, bool & toggle)
{
istringstream is(data);
- Lexer lex(0,0);
+ Lexer lex;
lex.setStream(is);
int nset = 0;
} 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();