#include "LayoutFile.h"
#include "BranchList.h"
#include "Buffer.h"
-#include "buffer_funcs.h"
#include "Bullet.h"
#include "CiteEnginesList.h"
#include "Color.h"
#include "ColorSet.h"
#include "Converter.h"
#include "Encoding.h"
+#include "Format.h"
#include "IndicesList.h"
#include "Language.h"
#include "LaTeXFeatures.h"
#include "LaTeXFonts.h"
-#include "Length.h"
-#include "ModuleList.h"
#include "Font.h"
#include "Lexer.h"
#include "LyXRC.h"
#include "frontends/alert.h"
#include "insets/InsetListingsParams.h"
+#include "insets/InsetQuotes.h"
#include "support/convert.h"
#include "support/debug.h"
-#include "support/docstream.h"
#include "support/FileName.h"
#include "support/filetools.h"
#include "support/gettext.h"
+#include "support/Length.h"
#include "support/Messages.h"
#include "support/mutex.h"
#include "support/Package.h"
static char const * const string_quotes_style[] = {
"english", "swedish", "german", "polish", "swiss", "danish", "plain",
- "british", "swedishg", "french", "frenchin", "russian", "cjk", "cjkangle", ""
+ "british", "swedishg", "french", "frenchin", "russian", "cjk", "cjkangle",
+ "hungarian", ""
};
// Quotes style
-typedef Translator<string, InsetQuotesParams::QuoteStyle> QuotesStyleTranslator;
+typedef Translator<string, QuoteStyle> QuotesStyleTranslator;
QuotesStyleTranslator const init_quotesstyletranslator()
{
QuotesStyleTranslator translator
- (string_quotes_style[0], InsetQuotesParams::EnglishQuotes);
- translator.addPair(string_quotes_style[1], InsetQuotesParams::SwedishQuotes);
- translator.addPair(string_quotes_style[2], InsetQuotesParams::GermanQuotes);
- translator.addPair(string_quotes_style[3], InsetQuotesParams::PolishQuotes);
- translator.addPair(string_quotes_style[4], InsetQuotesParams::SwissQuotes);
- translator.addPair(string_quotes_style[5], InsetQuotesParams::DanishQuotes);
- translator.addPair(string_quotes_style[6], InsetQuotesParams::PlainQuotes);
- translator.addPair(string_quotes_style[7], InsetQuotesParams::BritishQuotes);
- translator.addPair(string_quotes_style[8], InsetQuotesParams::SwedishGQuotes);
- translator.addPair(string_quotes_style[9], InsetQuotesParams::FrenchQuotes);
- translator.addPair(string_quotes_style[10], InsetQuotesParams::FrenchINQuotes);
- translator.addPair(string_quotes_style[11], InsetQuotesParams::RussianQuotes);
- translator.addPair(string_quotes_style[12], InsetQuotesParams::CJKQuotes);
- translator.addPair(string_quotes_style[13], InsetQuotesParams::CJKAngleQuotes);
+ (string_quotes_style[0], QuoteStyle::English);
+ translator.addPair(string_quotes_style[1], QuoteStyle::Swedish);
+ translator.addPair(string_quotes_style[2], QuoteStyle::German);
+ translator.addPair(string_quotes_style[3], QuoteStyle::Polish);
+ translator.addPair(string_quotes_style[4], QuoteStyle::Swiss);
+ translator.addPair(string_quotes_style[5], QuoteStyle::Danish);
+ translator.addPair(string_quotes_style[6], QuoteStyle::Plain);
+ translator.addPair(string_quotes_style[7], QuoteStyle::British);
+ translator.addPair(string_quotes_style[8], QuoteStyle::SwedishG);
+ translator.addPair(string_quotes_style[9], QuoteStyle::French);
+ translator.addPair(string_quotes_style[10], QuoteStyle::FrenchIN);
+ translator.addPair(string_quotes_style[11], QuoteStyle::Russian);
+ translator.addPair(string_quotes_style[12], QuoteStyle::CJK);
+ translator.addPair(string_quotes_style[13], QuoteStyle::CJKAngle);
+ translator.addPair(string_quotes_style[14], QuoteStyle::Hungarian);
return translator;
}
paragraph_separation = ParagraphIndentSeparation;
is_math_indent = false;
math_numbering_side = DEFAULT;
- quotes_style = InsetQuotesParams::EnglishQuotes;
+ quotes_style = QuoteStyle::English;
dynamic_quotes = false;
fontsize = "default";
listings_params = string();
pagestyle = "default";
tablestyle = "default";
+ float_alignment = "class";
+ float_placement = "class";
suppress_date = false;
justification = true;
// no color is the default (white)
}
-void BufferParams::addAuthor(Author a)
+void BufferParams::addAuthor(Author const & a)
{
author_map_[a.bufferId()] = pimpl_->authorlist.record(a);
}
branch_ptr->setColor(color);
// Update also the Color table:
if (color == "none")
- color = lcolor.getX11Name(Color_background);
+ color = lcolor.getX11HexName(Color_background);
// FIXME UNICODE
lcolor.setColor(to_utf8(branch), color);
}
index_ptr->setColor(color);
// Update also the Color table:
if (color == "none")
- color = lcolor.getX11Name(Color_background);
+ color = lcolor.getX11HexName(Color_background);
// FIXME UNICODE
if (!shortcut.empty())
lcolor.setColor(to_utf8(shortcut), color);
if (!lineno_opts.empty())
os << "\\lineno_options " << lineno_opts << '\n';
- if (isbackgroundcolor == true)
+ if (isbackgroundcolor)
os << "\\backgroundcolor " << lyx::X11hexname(backgroundcolor) << '\n';
- if (isfontcolor == true)
+ if (isfontcolor)
os << "\\fontcolor " << lyx::X11hexname(fontcolor) << '\n';
if (notefontcolor != lyx::rgbFromHexName("#cccccc"))
os << "\\notefontcolor " << lyx::X11hexname(notefontcolor) << '\n';
os << "default";
}
os << "\n\\quotes_style "
- << string_quotes_style[quotes_style]
+ << string_quotes_style[static_cast<int>(quotes_style)]
<< "\n\\dynamic_quotes " << dynamic_quotes
<< "\n\\papercolumns " << columns
<< "\n\\papersides " << sides
LaTeXFeatures::isAvailable("xcolor");
switch (features.runparams().flavor) {
- case OutputParams::LATEX:
- case OutputParams::DVILUATEX:
+ case Flavor::LaTeX:
+ case Flavor::DviLuaTeX:
if (xcolorulem) {
features.require("ct-xcolor-ulem");
features.require("ulem");
features.require("ct-none");
}
break;
- case OutputParams::LUATEX:
- case OutputParams::PDFLATEX:
- case OutputParams::XETEX:
+ case Flavor::LuaTeX:
+ case Flavor::PdfLaTeX:
+ case Flavor::XeTeX:
if (xcolorulem) {
features.require("ct-xcolor-ulem");
features.require("ulem");
docstring options_encodable;
Encoding const * const enc = features.runparams().encoding;
if (enc) {
- for (size_t n = 0; n < strOptions.size(); ++n) {
- char_type c = strOptions[n];
+ for (char_type c : strOptions) {
if (!enc->encodable(c)) {
docstring const glyph(1, c);
LYXERR0("Uncodable character '"
}
// only output when the background color is not default
- if (isbackgroundcolor == true) {
+ if (isbackgroundcolor) {
// only require color here, the background color will be defined
// in LaTeXFeatures.cpp to avoid interferences with the LaTeX
// package pdfpages
}
// only output when the font color is not default
- if (isfontcolor == true) {
+ if (isfontcolor) {
// only require color here, the font color will be defined
// in LaTeXFeatures.cpp to avoid interferences with the LaTeX
// package pdfpages
if (output_sync) {
if (!output_sync_macro.empty())
os << from_utf8(output_sync_macro) +"\n";
- else if (features.runparams().flavor == OutputParams::LATEX)
+ else if (features.runparams().flavor == Flavor::LaTeX)
os << "\\usepackage[active]{srcltx}\n";
- else if (features.runparams().flavor == OutputParams::PDFLATEX)
+ else if (features.runparams().flavor == Flavor::PdfLaTeX)
os << "\\synctex=-1\n";
}
docstring uncodable_glyphs;
Encoding const * const enc = features.runparams().encoding;
if (enc) {
- for (size_t n = 0; n < preamble.size(); ++n) {
- char_type c = preamble[n];
+ for (char_type c : preamble) {
if (!enc->encodable(c)) {
docstring const glyph(1, c);
LYXERR0("Uncodable character '"
&& !features.isProvided("xunicode")) {
// The `xunicode` package officially only supports XeTeX,
// but also works with LuaTeX. We work around its XeTeX test.
- if (features.runparams().flavor != OutputParams::XETEX) {
+ if (features.runparams().flavor != Flavor::XeTeX) {
os << "% Pretend to xunicode that we are XeTeX\n"
<< "\\def\\XeTeXpicfile{}\n";
}
}
-OutputParams::FLAVOR BufferParams::getOutputFlavor(string const & format) const
+Flavor BufferParams::getOutputFlavor(string const & format) const
{
string const dformat = (format.empty() || format == "default") ?
getDefaultOutputFormat() : format;
if (it != default_flavors_.end())
return it->second;
- OutputParams::FLAVOR result = OutputParams::LATEX;
+ Flavor result = Flavor::LaTeX;
// FIXME It'd be better not to hardcode this, but to do
// something with formats.
if (dformat == "xhtml")
- result = OutputParams::HTML;
+ result = Flavor::Html;
else if (dformat == "docbook5")
- result = OutputParams::DOCBOOK5;
+ result = Flavor::DocBook5;
else if (dformat == "text")
- result = OutputParams::TEXT;
+ result = Flavor::Text;
else if (dformat == "lyx")
- result = OutputParams::LYX;
+ result = Flavor::LyX;
else if (dformat == "pdflatex")
- result = OutputParams::PDFLATEX;
+ result = Flavor::PdfLaTeX;
else if (dformat == "xetex")
- result = OutputParams::XETEX;
+ result = Flavor::XeTeX;
else if (dformat == "luatex")
- result = OutputParams::LUATEX;
+ result = Flavor::LuaTeX;
else if (dformat == "dviluatex")
- result = OutputParams::DVILUATEX;
+ result = Flavor::DviLuaTeX;
else {
// Try to determine flavor of default output format
vector<string> backs = backends();
}
-InsetQuotesParams::QuoteStyle BufferParams::getQuoteStyle(string const & qs) const
+QuoteStyle BufferParams::getQuoteStyle(string const & qs) const
{
return quotesstyletranslator().find(qs);
}
// Create list of inputenc options:
set<string> encoding_set;
// luainputenc fails with more than one encoding
- if (features.runparams().flavor != OutputParams::LUATEX
- && features.runparams().flavor != OutputParams::DVILUATEX)
+ if (features.runparams().flavor != Flavor::LuaTeX
+ && features.runparams().flavor != Flavor::DviLuaTeX)
// list all input encodings used in the document
encoding_set = features.getEncodingSet(doc_encoding);
os << ',';
os << from_ascii(doc_encoding);
}
- if (features.runparams().flavor == OutputParams::LUATEX
- || features.runparams().flavor == OutputParams::DVILUATEX)
+ if (features.runparams().flavor == Flavor::LuaTeX
+ || features.runparams().flavor == Flavor::DviLuaTeX)
os << "]{luainputenc}\n";
else
os << "]{inputenc}\n";
|| features.isProvided("inputenc"))
break;
os << "\\usepackage[" << from_ascii(encoding().latexName());
- if (features.runparams().flavor == OutputParams::LUATEX
- || features.runparams().flavor == OutputParams::DVILUATEX)
+ if (features.runparams().flavor == Flavor::LuaTeX
+ || features.runparams().flavor == Flavor::DviLuaTeX)
os << "]{luainputenc}\n";
else
os << "]{inputenc}\n";
bool const babelfonts = features.useBabel()
&& features.isAvailable("babel-2017/11/03");
string const texmapping =
- (features.runparams().flavor == OutputParams::XETEX) ?
+ (features.runparams().flavor == Flavor::XeTeX) ?
"Mapping=tex-text" : "Ligatures=TeX";
if (fontsRoman() != "default") {
if (babelfonts)
bool const ot1 = (main_font_encoding() == "default" || main_font_encoding() == "OT1");
bool const dryrun = features.runparams().dryrun;
bool const complete = (fontsSans() == "default" && fontsTypewriter() == "default");
- bool const nomath = (fontsMath() == "default");
+ bool const nomath = (fontsMath() != "auto");
// ROMAN FONTS
os << theLaTeXFonts().getLaTeXFont(from_ascii(fontsRoman())).getLaTeXCode(
}
-bool const & BufferParams::fullAuthorList() const
+bool BufferParams::fullAuthorList() const
{
return documentClass().fullAuthorList();
}