mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Better naming for enums
This commit is contained in:
parent
890ca6df7b
commit
c0a5987181
@ -2321,7 +2321,7 @@ int Buffer::runChktex()
|
|||||||
|
|
||||||
// Generate the LaTeX file if neccessary
|
// Generate the LaTeX file if neccessary
|
||||||
OutputParams runparams(¶ms().encoding());
|
OutputParams runparams(¶ms().encoding());
|
||||||
runparams.flavor = FLAVOR::LATEX;
|
runparams.flavor = Flavor::LaTeX;
|
||||||
runparams.nice = false;
|
runparams.nice = false;
|
||||||
runparams.linelen = lyxrc.plaintext_linelen;
|
runparams.linelen = lyxrc.plaintext_linelen;
|
||||||
ExportStatus const retval =
|
ExportStatus const retval =
|
||||||
@ -4069,23 +4069,23 @@ unique_ptr<TexRow> Buffer::getSourceCode(odocstream & os, string const & format,
|
|||||||
<< "\n\n";
|
<< "\n\n";
|
||||||
}
|
}
|
||||||
// output paragraphs
|
// output paragraphs
|
||||||
if (runparams.flavor == FLAVOR::LYX) {
|
if (runparams.flavor == Flavor::LyX) {
|
||||||
Paragraph const & par = text().paragraphs()[par_begin];
|
Paragraph const & par = text().paragraphs()[par_begin];
|
||||||
ostringstream ods;
|
ostringstream ods;
|
||||||
depth_type dt = par.getDepth();
|
depth_type dt = par.getDepth();
|
||||||
par.write(ods, params(), dt);
|
par.write(ods, params(), dt);
|
||||||
os << from_utf8(ods.str());
|
os << from_utf8(ods.str());
|
||||||
} else if (runparams.flavor == FLAVOR::HTML) {
|
} else if (runparams.flavor == Flavor::Html) {
|
||||||
XMLStream xs(os);
|
XMLStream xs(os);
|
||||||
setMathFlavor(runparams);
|
setMathFlavor(runparams);
|
||||||
xhtmlParagraphs(text(), *this, xs, runparams);
|
xhtmlParagraphs(text(), *this, xs, runparams);
|
||||||
} else if (runparams.flavor == FLAVOR::TEXT) {
|
} else if (runparams.flavor == Flavor::Text) {
|
||||||
bool dummy = false;
|
bool dummy = false;
|
||||||
// FIXME Handles only one paragraph, unlike the others.
|
// FIXME Handles only one paragraph, unlike the others.
|
||||||
// Probably should have some routine with a signature like them.
|
// Probably should have some routine with a signature like them.
|
||||||
writePlaintextParagraph(*this,
|
writePlaintextParagraph(*this,
|
||||||
text().paragraphs()[par_begin], os, runparams, dummy);
|
text().paragraphs()[par_begin], os, runparams, dummy);
|
||||||
} else if (runparams.flavor == FLAVOR::DOCBOOK5) {
|
} else if (runparams.flavor == Flavor::DocBook5) {
|
||||||
XMLStream xs{os};
|
XMLStream xs{os};
|
||||||
docbookParagraphs(text(), *this, xs, runparams);
|
docbookParagraphs(text(), *this, xs, runparams);
|
||||||
} else {
|
} else {
|
||||||
@ -4123,7 +4123,7 @@ unique_ptr<TexRow> Buffer::getSourceCode(odocstream & os, string const & format,
|
|||||||
else if (output == OnlyBody)
|
else if (output == OnlyBody)
|
||||||
os << _("Preview body");
|
os << _("Preview body");
|
||||||
os << "\n\n";
|
os << "\n\n";
|
||||||
if (runparams.flavor == FLAVOR::LYX) {
|
if (runparams.flavor == Flavor::LyX) {
|
||||||
ostringstream ods;
|
ostringstream ods;
|
||||||
if (output == FullSource)
|
if (output == FullSource)
|
||||||
write(ods);
|
write(ods);
|
||||||
@ -4132,14 +4132,14 @@ unique_ptr<TexRow> Buffer::getSourceCode(odocstream & os, string const & format,
|
|||||||
else if (output == OnlyBody)
|
else if (output == OnlyBody)
|
||||||
text().write(ods);
|
text().write(ods);
|
||||||
os << from_utf8(ods.str());
|
os << from_utf8(ods.str());
|
||||||
} else if (runparams.flavor == FLAVOR::HTML) {
|
} else if (runparams.flavor == Flavor::Html) {
|
||||||
writeLyXHTMLSource(os, runparams, output);
|
writeLyXHTMLSource(os, runparams, output);
|
||||||
} else if (runparams.flavor == FLAVOR::TEXT) {
|
} else if (runparams.flavor == Flavor::Text) {
|
||||||
if (output == OnlyPreamble) {
|
if (output == OnlyPreamble) {
|
||||||
os << "% "<< _("Plain text does not have a preamble.");
|
os << "% "<< _("Plain text does not have a preamble.");
|
||||||
} else
|
} else
|
||||||
writePlaintextFile(*this, os, runparams);
|
writePlaintextFile(*this, os, runparams);
|
||||||
} else if (runparams.flavor == FLAVOR::DOCBOOK5) {
|
} else if (runparams.flavor == Flavor::DocBook5) {
|
||||||
writeDocBookSource(os, runparams, output);
|
writeDocBookSource(os, runparams, output);
|
||||||
} else {
|
} else {
|
||||||
// latex or literate
|
// latex or literate
|
||||||
@ -4374,7 +4374,7 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
|
|||||||
}
|
}
|
||||||
MarkAsExporting exporting(this);
|
MarkAsExporting exporting(this);
|
||||||
string backend_format;
|
string backend_format;
|
||||||
runparams.flavor = FLAVOR::LATEX;
|
runparams.flavor = Flavor::LaTeX;
|
||||||
runparams.linelen = lyxrc.plaintext_linelen;
|
runparams.linelen = lyxrc.plaintext_linelen;
|
||||||
runparams.includeall = includeall;
|
runparams.includeall = includeall;
|
||||||
vector<string> backs = params().backends();
|
vector<string> backs = params().backends();
|
||||||
@ -4418,13 +4418,13 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
|
|||||||
LYXERR(Debug::FILES, "backend_format=" << backend_format);
|
LYXERR(Debug::FILES, "backend_format=" << backend_format);
|
||||||
// FIXME: Don't hardcode format names here, but use a flag
|
// FIXME: Don't hardcode format names here, but use a flag
|
||||||
if (backend_format == "pdflatex")
|
if (backend_format == "pdflatex")
|
||||||
runparams.flavor = FLAVOR::PDFLATEX;
|
runparams.flavor = Flavor::PdfLaTeX;
|
||||||
else if (backend_format == "luatex")
|
else if (backend_format == "luatex")
|
||||||
runparams.flavor = FLAVOR::LUATEX;
|
runparams.flavor = Flavor::LuaTeX;
|
||||||
else if (backend_format == "dviluatex")
|
else if (backend_format == "dviluatex")
|
||||||
runparams.flavor = FLAVOR::DVILUATEX;
|
runparams.flavor = Flavor::DviLuaTeX;
|
||||||
else if (backend_format == "xetex")
|
else if (backend_format == "xetex")
|
||||||
runparams.flavor = FLAVOR::XETEX;
|
runparams.flavor = Flavor::XeTeX;
|
||||||
}
|
}
|
||||||
|
|
||||||
string filename = latexName(false);
|
string filename = latexName(false);
|
||||||
@ -4435,7 +4435,7 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
|
|||||||
|
|
||||||
// Plain text backend
|
// Plain text backend
|
||||||
if (backend_format == "text") {
|
if (backend_format == "text") {
|
||||||
runparams.flavor = FLAVOR::TEXT;
|
runparams.flavor = Flavor::Text;
|
||||||
try {
|
try {
|
||||||
writePlaintextFile(*this, FileName(filename), runparams);
|
writePlaintextFile(*this, FileName(filename), runparams);
|
||||||
}
|
}
|
||||||
@ -4443,7 +4443,7 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
|
|||||||
}
|
}
|
||||||
// HTML backend
|
// HTML backend
|
||||||
else if (backend_format == "xhtml") {
|
else if (backend_format == "xhtml") {
|
||||||
runparams.flavor = FLAVOR::HTML;
|
runparams.flavor = Flavor::Html;
|
||||||
setMathFlavor(runparams);
|
setMathFlavor(runparams);
|
||||||
if (makeLyXHTMLFile(FileName(filename), runparams) == ExportKilled)
|
if (makeLyXHTMLFile(FileName(filename), runparams) == ExportKilled)
|
||||||
return ExportKilled;
|
return ExportKilled;
|
||||||
@ -4451,7 +4451,7 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
|
|||||||
writeFile(FileName(filename));
|
writeFile(FileName(filename));
|
||||||
// DocBook backend
|
// DocBook backend
|
||||||
else if (backend_format == "docbook5") {
|
else if (backend_format == "docbook5") {
|
||||||
runparams.flavor = FLAVOR::DOCBOOK5;
|
runparams.flavor = Flavor::DocBook5;
|
||||||
runparams.nice = false;
|
runparams.nice = false;
|
||||||
if (makeDocBookFile(FileName(filename), runparams) == ExportKilled)
|
if (makeDocBookFile(FileName(filename), runparams) == ExportKilled)
|
||||||
return ExportKilled;
|
return ExportKilled;
|
||||||
|
@ -142,20 +142,20 @@ typedef Translator<string, QuoteStyle> QuotesStyleTranslator;
|
|||||||
QuotesStyleTranslator const init_quotesstyletranslator()
|
QuotesStyleTranslator const init_quotesstyletranslator()
|
||||||
{
|
{
|
||||||
QuotesStyleTranslator translator
|
QuotesStyleTranslator translator
|
||||||
(string_quotes_style[0], QuoteStyle::EnglishQuotes);
|
(string_quotes_style[0], QuoteStyle::English);
|
||||||
translator.addPair(string_quotes_style[1], QuoteStyle::SwedishQuotes);
|
translator.addPair(string_quotes_style[1], QuoteStyle::Swedish);
|
||||||
translator.addPair(string_quotes_style[2], QuoteStyle::GermanQuotes);
|
translator.addPair(string_quotes_style[2], QuoteStyle::German);
|
||||||
translator.addPair(string_quotes_style[3], QuoteStyle::PolishQuotes);
|
translator.addPair(string_quotes_style[3], QuoteStyle::Polish);
|
||||||
translator.addPair(string_quotes_style[4], QuoteStyle::SwissQuotes);
|
translator.addPair(string_quotes_style[4], QuoteStyle::Swiss);
|
||||||
translator.addPair(string_quotes_style[5], QuoteStyle::DanishQuotes);
|
translator.addPair(string_quotes_style[5], QuoteStyle::Danish);
|
||||||
translator.addPair(string_quotes_style[6], QuoteStyle::PlainQuotes);
|
translator.addPair(string_quotes_style[6], QuoteStyle::Plain);
|
||||||
translator.addPair(string_quotes_style[7], QuoteStyle::BritishQuotes);
|
translator.addPair(string_quotes_style[7], QuoteStyle::British);
|
||||||
translator.addPair(string_quotes_style[8], QuoteStyle::SwedishGQuotes);
|
translator.addPair(string_quotes_style[8], QuoteStyle::SwedishG);
|
||||||
translator.addPair(string_quotes_style[9], QuoteStyle::FrenchQuotes);
|
translator.addPair(string_quotes_style[9], QuoteStyle::French);
|
||||||
translator.addPair(string_quotes_style[10], QuoteStyle::FrenchINQuotes);
|
translator.addPair(string_quotes_style[10], QuoteStyle::FrenchIN);
|
||||||
translator.addPair(string_quotes_style[11], QuoteStyle::RussianQuotes);
|
translator.addPair(string_quotes_style[11], QuoteStyle::Russian);
|
||||||
translator.addPair(string_quotes_style[12], QuoteStyle::CJKQuotes);
|
translator.addPair(string_quotes_style[12], QuoteStyle::CJK);
|
||||||
translator.addPair(string_quotes_style[13], QuoteStyle::CJKAngleQuotes);
|
translator.addPair(string_quotes_style[13], QuoteStyle::CJKAngle);
|
||||||
return translator;
|
return translator;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,7 +394,7 @@ BufferParams::BufferParams()
|
|||||||
paragraph_separation = ParagraphIndentSeparation;
|
paragraph_separation = ParagraphIndentSeparation;
|
||||||
is_math_indent = false;
|
is_math_indent = false;
|
||||||
math_numbering_side = DEFAULT;
|
math_numbering_side = DEFAULT;
|
||||||
quotes_style = QuoteStyle::EnglishQuotes;
|
quotes_style = QuoteStyle::English;
|
||||||
dynamic_quotes = false;
|
dynamic_quotes = false;
|
||||||
fontsize = "default";
|
fontsize = "default";
|
||||||
|
|
||||||
@ -1522,8 +1522,8 @@ void BufferParams::validate(LaTeXFeatures & features) const
|
|||||||
LaTeXFeatures::isAvailable("xcolor");
|
LaTeXFeatures::isAvailable("xcolor");
|
||||||
|
|
||||||
switch (features.runparams().flavor) {
|
switch (features.runparams().flavor) {
|
||||||
case FLAVOR::LATEX:
|
case Flavor::LaTeX:
|
||||||
case FLAVOR::DVILUATEX:
|
case Flavor::DviLuaTeX:
|
||||||
if (xcolorulem) {
|
if (xcolorulem) {
|
||||||
features.require("ct-xcolor-ulem");
|
features.require("ct-xcolor-ulem");
|
||||||
features.require("ulem");
|
features.require("ulem");
|
||||||
@ -1532,9 +1532,9 @@ void BufferParams::validate(LaTeXFeatures & features) const
|
|||||||
features.require("ct-none");
|
features.require("ct-none");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FLAVOR::LUATEX:
|
case Flavor::LuaTeX:
|
||||||
case FLAVOR::PDFLATEX:
|
case Flavor::PdfLaTeX:
|
||||||
case FLAVOR::XETEX:
|
case Flavor::XeTeX:
|
||||||
if (xcolorulem) {
|
if (xcolorulem) {
|
||||||
features.require("ct-xcolor-ulem");
|
features.require("ct-xcolor-ulem");
|
||||||
features.require("ulem");
|
features.require("ulem");
|
||||||
@ -2067,9 +2067,9 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
|||||||
if (output_sync) {
|
if (output_sync) {
|
||||||
if (!output_sync_macro.empty())
|
if (!output_sync_macro.empty())
|
||||||
os << from_utf8(output_sync_macro) +"\n";
|
os << from_utf8(output_sync_macro) +"\n";
|
||||||
else if (features.runparams().flavor == FLAVOR::LATEX)
|
else if (features.runparams().flavor == Flavor::LaTeX)
|
||||||
os << "\\usepackage[active]{srcltx}\n";
|
os << "\\usepackage[active]{srcltx}\n";
|
||||||
else if (features.runparams().flavor == FLAVOR::PDFLATEX)
|
else if (features.runparams().flavor == Flavor::PdfLaTeX)
|
||||||
os << "\\synctex=-1\n";
|
os << "\\synctex=-1\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2346,7 +2346,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
|||||||
&& !features.isProvided("xunicode")) {
|
&& !features.isProvided("xunicode")) {
|
||||||
// The `xunicode` package officially only supports XeTeX,
|
// The `xunicode` package officially only supports XeTeX,
|
||||||
// but also works with LuaTeX. We work around its XeTeX test.
|
// but also works with LuaTeX. We work around its XeTeX test.
|
||||||
if (features.runparams().flavor != FLAVOR::XETEX) {
|
if (features.runparams().flavor != Flavor::XeTeX) {
|
||||||
os << "% Pretend to xunicode that we are XeTeX\n"
|
os << "% Pretend to xunicode that we are XeTeX\n"
|
||||||
<< "\\def\\XeTeXpicfile{}\n";
|
<< "\\def\\XeTeXpicfile{}\n";
|
||||||
}
|
}
|
||||||
@ -2713,7 +2713,7 @@ vector<string> BufferParams::backends() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FLAVOR BufferParams::getOutputFlavor(string const & format) const
|
Flavor BufferParams::getOutputFlavor(string const & format) const
|
||||||
{
|
{
|
||||||
string const dformat = (format.empty() || format == "default") ?
|
string const dformat = (format.empty() || format == "default") ?
|
||||||
getDefaultOutputFormat() : format;
|
getDefaultOutputFormat() : format;
|
||||||
@ -2723,26 +2723,26 @@ FLAVOR BufferParams::getOutputFlavor(string const & format) const
|
|||||||
if (it != default_flavors_.end())
|
if (it != default_flavors_.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
|
|
||||||
FLAVOR result = FLAVOR::LATEX;
|
Flavor result = Flavor::LaTeX;
|
||||||
|
|
||||||
// FIXME It'd be better not to hardcode this, but to do
|
// FIXME It'd be better not to hardcode this, but to do
|
||||||
// something with formats.
|
// something with formats.
|
||||||
if (dformat == "xhtml")
|
if (dformat == "xhtml")
|
||||||
result = FLAVOR::HTML;
|
result = Flavor::Html;
|
||||||
else if (dformat == "docbook5")
|
else if (dformat == "docbook5")
|
||||||
result = FLAVOR::DOCBOOK5;
|
result = Flavor::DocBook5;
|
||||||
else if (dformat == "text")
|
else if (dformat == "text")
|
||||||
result = FLAVOR::TEXT;
|
result = Flavor::Text;
|
||||||
else if (dformat == "lyx")
|
else if (dformat == "lyx")
|
||||||
result = FLAVOR::LYX;
|
result = Flavor::LyX;
|
||||||
else if (dformat == "pdflatex")
|
else if (dformat == "pdflatex")
|
||||||
result = FLAVOR::PDFLATEX;
|
result = Flavor::PdfLaTeX;
|
||||||
else if (dformat == "xetex")
|
else if (dformat == "xetex")
|
||||||
result = FLAVOR::XETEX;
|
result = Flavor::XeTeX;
|
||||||
else if (dformat == "luatex")
|
else if (dformat == "luatex")
|
||||||
result = FLAVOR::LUATEX;
|
result = Flavor::LuaTeX;
|
||||||
else if (dformat == "dviluatex")
|
else if (dformat == "dviluatex")
|
||||||
result = FLAVOR::DVILUATEX;
|
result = Flavor::DviLuaTeX;
|
||||||
else {
|
else {
|
||||||
// Try to determine flavor of default output format
|
// Try to determine flavor of default output format
|
||||||
vector<string> backs = backends();
|
vector<string> backs = backends();
|
||||||
@ -3256,8 +3256,8 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
|
|||||||
// Create list of inputenc options:
|
// Create list of inputenc options:
|
||||||
set<string> encoding_set;
|
set<string> encoding_set;
|
||||||
// luainputenc fails with more than one encoding
|
// luainputenc fails with more than one encoding
|
||||||
if (features.runparams().flavor != FLAVOR::LUATEX
|
if (features.runparams().flavor != Flavor::LuaTeX
|
||||||
&& features.runparams().flavor != FLAVOR::DVILUATEX)
|
&& features.runparams().flavor != Flavor::DviLuaTeX)
|
||||||
// list all input encodings used in the document
|
// list all input encodings used in the document
|
||||||
encoding_set = features.getEncodingSet(doc_encoding);
|
encoding_set = features.getEncodingSet(doc_encoding);
|
||||||
|
|
||||||
@ -3281,8 +3281,8 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
|
|||||||
os << ',';
|
os << ',';
|
||||||
os << from_ascii(doc_encoding);
|
os << from_ascii(doc_encoding);
|
||||||
}
|
}
|
||||||
if (features.runparams().flavor == FLAVOR::LUATEX
|
if (features.runparams().flavor == Flavor::LuaTeX
|
||||||
|| features.runparams().flavor == FLAVOR::DVILUATEX)
|
|| features.runparams().flavor == Flavor::DviLuaTeX)
|
||||||
os << "]{luainputenc}\n";
|
os << "]{luainputenc}\n";
|
||||||
else
|
else
|
||||||
os << "]{inputenc}\n";
|
os << "]{inputenc}\n";
|
||||||
@ -3305,8 +3305,8 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
|
|||||||
|| features.isProvided("inputenc"))
|
|| features.isProvided("inputenc"))
|
||||||
break;
|
break;
|
||||||
os << "\\usepackage[" << from_ascii(encoding().latexName());
|
os << "\\usepackage[" << from_ascii(encoding().latexName());
|
||||||
if (features.runparams().flavor == FLAVOR::LUATEX
|
if (features.runparams().flavor == Flavor::LuaTeX
|
||||||
|| features.runparams().flavor == FLAVOR::DVILUATEX)
|
|| features.runparams().flavor == Flavor::DviLuaTeX)
|
||||||
os << "]{luainputenc}\n";
|
os << "]{luainputenc}\n";
|
||||||
else
|
else
|
||||||
os << "]{inputenc}\n";
|
os << "]{inputenc}\n";
|
||||||
@ -3367,7 +3367,7 @@ string const BufferParams::loadFonts(LaTeXFeatures & features) const
|
|||||||
bool const babelfonts = features.useBabel()
|
bool const babelfonts = features.useBabel()
|
||||||
&& features.isAvailable("babel-2017/11/03");
|
&& features.isAvailable("babel-2017/11/03");
|
||||||
string const texmapping =
|
string const texmapping =
|
||||||
(features.runparams().flavor == FLAVOR::XETEX) ?
|
(features.runparams().flavor == Flavor::XeTeX) ?
|
||||||
"Mapping=tex-text" : "Ligatures=TeX";
|
"Mapping=tex-text" : "Ligatures=TeX";
|
||||||
if (fontsRoman() != "default") {
|
if (fontsRoman() != "default") {
|
||||||
if (babelfonts)
|
if (babelfonts)
|
||||||
|
@ -52,7 +52,7 @@ class PDFOptions;
|
|||||||
class Spacing;
|
class Spacing;
|
||||||
class VSpace;
|
class VSpace;
|
||||||
|
|
||||||
enum class FLAVOR : int;
|
enum class Flavor : int;
|
||||||
enum class QuoteStyle : int;
|
enum class QuoteStyle : int;
|
||||||
|
|
||||||
/** Buffer parameters.
|
/** Buffer parameters.
|
||||||
@ -198,7 +198,7 @@ public:
|
|||||||
/// return the default output format of the current backend
|
/// return the default output format of the current backend
|
||||||
std::string getDefaultOutputFormat() const;
|
std::string getDefaultOutputFormat() const;
|
||||||
/// return the output flavor of \p format or the default
|
/// return the output flavor of \p format or the default
|
||||||
FLAVOR getOutputFlavor(std::string const & format = std::string()) const;
|
Flavor getOutputFlavor(std::string const & format = std::string()) const;
|
||||||
///
|
///
|
||||||
bool isExportable(std::string const & format, bool need_viewable) const;
|
bool isExportable(std::string const & format, bool need_viewable) const;
|
||||||
///
|
///
|
||||||
@ -617,7 +617,7 @@ private:
|
|||||||
///
|
///
|
||||||
void readIncludeonly(Lexer &);
|
void readIncludeonly(Lexer &);
|
||||||
/// A cache for the default flavors
|
/// A cache for the default flavors
|
||||||
typedef std::map<std::string, FLAVOR> DefaultFlavorCache;
|
typedef std::map<std::string, Flavor> DefaultFlavorCache;
|
||||||
///
|
///
|
||||||
mutable DefaultFlavorCache default_flavors_;
|
mutable DefaultFlavorCache default_flavors_;
|
||||||
/// the cite engine
|
/// the cite engine
|
||||||
|
@ -259,28 +259,28 @@ void Converters::updateLast(Formats const & formats)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FLAVOR Converters::getFlavor(Graph::EdgePath const & path,
|
Flavor Converters::getFlavor(Graph::EdgePath const & path,
|
||||||
Buffer const * buffer) const
|
Buffer const * buffer) const
|
||||||
{
|
{
|
||||||
for (auto const & edge : path) {
|
for (auto const & edge : path) {
|
||||||
Converter const & conv = converterlist_[edge];
|
Converter const & conv = converterlist_[edge];
|
||||||
if (conv.latex() || conv.need_aux()) {
|
if (conv.latex() || conv.need_aux()) {
|
||||||
if (conv.latex_flavor() == "latex")
|
if (conv.latex_flavor() == "latex")
|
||||||
return FLAVOR::LATEX;
|
return Flavor::LaTeX;
|
||||||
if (conv.latex_flavor() == "xelatex")
|
if (conv.latex_flavor() == "xelatex")
|
||||||
return FLAVOR::XETEX;
|
return Flavor::XeTeX;
|
||||||
if (conv.latex_flavor() == "lualatex")
|
if (conv.latex_flavor() == "lualatex")
|
||||||
return FLAVOR::LUATEX;
|
return Flavor::LuaTeX;
|
||||||
if (conv.latex_flavor() == "dvilualatex")
|
if (conv.latex_flavor() == "dvilualatex")
|
||||||
return FLAVOR::DVILUATEX;
|
return Flavor::DviLuaTeX;
|
||||||
if (conv.latex_flavor() == "pdflatex")
|
if (conv.latex_flavor() == "pdflatex")
|
||||||
return FLAVOR::PDFLATEX;
|
return Flavor::PdfLaTeX;
|
||||||
}
|
}
|
||||||
if (conv.docbook())
|
if (conv.docbook())
|
||||||
return FLAVOR::DOCBOOK5;
|
return Flavor::DocBook5;
|
||||||
}
|
}
|
||||||
return buffer ? buffer->params().getOutputFlavor()
|
return buffer ? buffer->params().getOutputFlavor()
|
||||||
: FLAVOR::LATEX;
|
: Flavor::LaTeX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -602,16 +602,16 @@ Converters::RetVal Converters::convert(Buffer const * buffer,
|
|||||||
LASSERT(buffer, return FAILURE);
|
LASSERT(buffer, return FAILURE);
|
||||||
string command;
|
string command;
|
||||||
switch (runparams.flavor) {
|
switch (runparams.flavor) {
|
||||||
case FLAVOR::DVILUATEX:
|
case Flavor::DviLuaTeX:
|
||||||
command = dvilualatex_command_;
|
command = dvilualatex_command_;
|
||||||
break;
|
break;
|
||||||
case FLAVOR::LUATEX:
|
case Flavor::LuaTeX:
|
||||||
command = lualatex_command_;
|
command = lualatex_command_;
|
||||||
break;
|
break;
|
||||||
case FLAVOR::PDFLATEX:
|
case Flavor::PdfLaTeX:
|
||||||
command = pdflatex_command_;
|
command = pdflatex_command_;
|
||||||
break;
|
break;
|
||||||
case FLAVOR::XETEX:
|
case Flavor::XeTeX:
|
||||||
command = xelatex_command_;
|
command = xelatex_command_;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -833,7 +833,7 @@ bool Converters::scanLog(Buffer const & buffer, string const & /*command*/,
|
|||||||
FileName const & filename, ErrorList & errorList)
|
FileName const & filename, ErrorList & errorList)
|
||||||
{
|
{
|
||||||
OutputParams runparams(nullptr);
|
OutputParams runparams(nullptr);
|
||||||
runparams.flavor = FLAVOR::LATEX;
|
runparams.flavor = Flavor::LaTeX;
|
||||||
LaTeX latex("", runparams, filename);
|
LaTeX latex("", runparams, filename);
|
||||||
TeXErrors terr;
|
TeXErrors terr;
|
||||||
int const result = latex.scanLogFile(terr);
|
int const result = latex.scanLogFile(terr);
|
||||||
|
@ -30,7 +30,7 @@ class Format;
|
|||||||
class Formats;
|
class Formats;
|
||||||
class OutputParams;
|
class OutputParams;
|
||||||
|
|
||||||
enum class FLAVOR : int;
|
enum class Flavor : int;
|
||||||
|
|
||||||
class ConversionException : public std::exception {
|
class ConversionException : public std::exception {
|
||||||
public:
|
public:
|
||||||
@ -177,7 +177,7 @@ public:
|
|||||||
///
|
///
|
||||||
Graph::EdgePath getPath(std::string const & from, std::string const & to);
|
Graph::EdgePath getPath(std::string const & from, std::string const & to);
|
||||||
///
|
///
|
||||||
FLAVOR getFlavor(Graph::EdgePath const & path,
|
Flavor getFlavor(Graph::EdgePath const & path,
|
||||||
Buffer const * buffer = nullptr) const;
|
Buffer const * buffer = nullptr) const;
|
||||||
///
|
///
|
||||||
std::string getHyperrefDriver(Graph::EdgePath const & path) const;
|
std::string getHyperrefDriver(Graph::EdgePath const & path) const;
|
||||||
|
@ -819,20 +819,20 @@ string const Formats::extensions(string const & name) const
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
typedef Translator<FLAVOR, string> FlavorTranslator;
|
typedef Translator<Flavor, string> FlavorTranslator;
|
||||||
|
|
||||||
|
|
||||||
FlavorTranslator initFlavorTranslator()
|
FlavorTranslator initFlavorTranslator()
|
||||||
{
|
{
|
||||||
FlavorTranslator f(FLAVOR::LATEX, "latex");
|
FlavorTranslator f(Flavor::LaTeX, "latex");
|
||||||
f.addPair(FLAVOR::DVILUATEX, "dviluatex");
|
f.addPair(Flavor::DviLuaTeX, "dviluatex");
|
||||||
f.addPair(FLAVOR::LUATEX, "luatex");
|
f.addPair(Flavor::LuaTeX, "luatex");
|
||||||
f.addPair(FLAVOR::PDFLATEX, "pdflatex");
|
f.addPair(Flavor::PdfLaTeX, "pdflatex");
|
||||||
f.addPair(FLAVOR::XETEX, "xetex");
|
f.addPair(Flavor::XeTeX, "xetex");
|
||||||
f.addPair(FLAVOR::DOCBOOK5, "docbook-xml");
|
f.addPair(Flavor::DocBook5, "docbook-xml");
|
||||||
f.addPair(FLAVOR::HTML, "xhtml");
|
f.addPair(Flavor::Html, "xhtml");
|
||||||
f.addPair(FLAVOR::TEXT, "text");
|
f.addPair(Flavor::Text, "text");
|
||||||
f.addPair(FLAVOR::LYX, "lyx");
|
f.addPair(Flavor::LyX, "lyx");
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -846,14 +846,14 @@ FlavorTranslator const & flavorTranslator()
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
std::string flavor2format(FLAVOR flavor)
|
std::string flavor2format(Flavor flavor)
|
||||||
{
|
{
|
||||||
return flavorTranslator().find(flavor);
|
return flavorTranslator().find(flavor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Not currently needed, but I'll leave the code in case it is.
|
/* Not currently needed, but I'll leave the code in case it is.
|
||||||
FLAVOR format2flavor(std::string fmt)
|
Flavor format2flavor(std::string fmt)
|
||||||
{
|
{
|
||||||
return flavorTranslator().find(fmt);
|
return flavorTranslator().find(fmt);
|
||||||
} */
|
} */
|
||||||
|
@ -24,7 +24,7 @@ namespace support { class FileName; }
|
|||||||
|
|
||||||
class Buffer;
|
class Buffer;
|
||||||
|
|
||||||
enum class FLAVOR : int;
|
enum class Flavor : int;
|
||||||
|
|
||||||
class Format {
|
class Format {
|
||||||
public:
|
public:
|
||||||
@ -220,9 +220,9 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
std::string flavor2format(FLAVOR flavor);
|
std::string flavor2format(Flavor flavor);
|
||||||
// Not currently used.
|
// Not currently used.
|
||||||
// FLAVOR format2flavor(std::string fmt);
|
// Flavor format2flavor(std::string fmt);
|
||||||
|
|
||||||
/// The global instance.
|
/// The global instance.
|
||||||
/// Implementation is in LyX.cpp.
|
/// Implementation is in LyX.cpp.
|
||||||
|
@ -1263,8 +1263,8 @@ string const LaTeXFeatures::getPackages() const
|
|||||||
|
|
||||||
if (mustProvide("changebar")) {
|
if (mustProvide("changebar")) {
|
||||||
packages << "\\usepackage";
|
packages << "\\usepackage";
|
||||||
if (runparams_.flavor == FLAVOR::LATEX
|
if (runparams_.flavor == Flavor::LaTeX
|
||||||
|| runparams_.flavor == FLAVOR::DVILUATEX)
|
|| runparams_.flavor == Flavor::DviLuaTeX)
|
||||||
packages << "[dvips]";
|
packages << "[dvips]";
|
||||||
packages << "{changebar}\n";
|
packages << "{changebar}\n";
|
||||||
}
|
}
|
||||||
@ -1278,8 +1278,8 @@ string const LaTeXFeatures::getPackages() const
|
|||||||
|
|
||||||
// [pdf]lscape is used to rotate longtables
|
// [pdf]lscape is used to rotate longtables
|
||||||
if (mustProvide("lscape")) {
|
if (mustProvide("lscape")) {
|
||||||
if (runparams_.flavor == FLAVOR::LATEX
|
if (runparams_.flavor == Flavor::LaTeX
|
||||||
|| runparams_.flavor == FLAVOR::DVILUATEX)
|
|| runparams_.flavor == Flavor::DviLuaTeX)
|
||||||
packages << "\\usepackage{lscape}\n";
|
packages << "\\usepackage{lscape}\n";
|
||||||
else
|
else
|
||||||
packages << "\\usepackage{pdflscape}\n";
|
packages << "\\usepackage{pdflscape}\n";
|
||||||
@ -1526,10 +1526,10 @@ TexString LaTeXFeatures::getMacros() const
|
|||||||
macros << "\\XeTeXdashbreakstate 0" << '\n';
|
macros << "\\XeTeXdashbreakstate 0" << '\n';
|
||||||
|
|
||||||
if (mustProvide("papersize")) {
|
if (mustProvide("papersize")) {
|
||||||
if (runparams_.flavor == FLAVOR::LATEX
|
if (runparams_.flavor == Flavor::LaTeX
|
||||||
|| runparams_.flavor == FLAVOR::DVILUATEX)
|
|| runparams_.flavor == Flavor::DviLuaTeX)
|
||||||
macros << papersizedvi_def << '\n';
|
macros << papersizedvi_def << '\n';
|
||||||
else if (runparams_.flavor == FLAVOR::LUATEX)
|
else if (runparams_.flavor == Flavor::LuaTeX)
|
||||||
macros << papersizepdflua_def << '\n';
|
macros << papersizepdflua_def << '\n';
|
||||||
else
|
else
|
||||||
macros << papersizepdf_def << '\n';
|
macros << papersizepdf_def << '\n';
|
||||||
@ -1655,13 +1655,13 @@ TexString LaTeXFeatures::getMacros() const
|
|||||||
if (mustProvide("textquotedbl"))
|
if (mustProvide("textquotedbl"))
|
||||||
macros << textquotedbl_def << '\n';
|
macros << textquotedbl_def << '\n';
|
||||||
if (mustProvide("textquotesinglep")) {
|
if (mustProvide("textquotesinglep")) {
|
||||||
if (runparams_.flavor == FLAVOR::XETEX)
|
if (runparams_.flavor == Flavor::XeTeX)
|
||||||
macros << textquotesinglep_xetex_def << '\n';
|
macros << textquotesinglep_xetex_def << '\n';
|
||||||
else
|
else
|
||||||
macros << textquotesinglep_luatex_def << '\n';
|
macros << textquotesinglep_luatex_def << '\n';
|
||||||
}
|
}
|
||||||
if (mustProvide("textquotedblp")) {
|
if (mustProvide("textquotedblp")) {
|
||||||
if (runparams_.flavor == FLAVOR::XETEX)
|
if (runparams_.flavor == Flavor::XeTeX)
|
||||||
macros << textquotedblp_xetex_def << '\n';
|
macros << textquotedblp_xetex_def << '\n';
|
||||||
else
|
else
|
||||||
macros << textquotedblp_luatex_def << '\n';
|
macros << textquotedblp_luatex_def << '\n';
|
||||||
@ -1689,7 +1689,7 @@ TexString LaTeXFeatures::getMacros() const
|
|||||||
if (mustProvide("lyxgreyedout")) {
|
if (mustProvide("lyxgreyedout")) {
|
||||||
// We need different version for RTL (#8647)
|
// We need different version for RTL (#8647)
|
||||||
if (hasRTLLanguage()) {
|
if (hasRTLLanguage()) {
|
||||||
if (runparams_.flavor == FLAVOR::LUATEX)
|
if (runparams_.flavor == Flavor::LuaTeX)
|
||||||
if (useBabel())
|
if (useBabel())
|
||||||
macros << lyxgreyedout_luartl_babel_def;
|
macros << lyxgreyedout_luartl_babel_def;
|
||||||
else
|
else
|
||||||
|
@ -36,25 +36,25 @@ OutputParams::~OutputParams()
|
|||||||
|
|
||||||
bool OutputParams::isLaTeX() const
|
bool OutputParams::isLaTeX() const
|
||||||
{
|
{
|
||||||
return flavor == FLAVOR::LATEX
|
return flavor == Flavor::LaTeX
|
||||||
|| flavor == FLAVOR::LUATEX
|
|| flavor == Flavor::LuaTeX
|
||||||
|| flavor == FLAVOR::DVILUATEX
|
|| flavor == Flavor::DviLuaTeX
|
||||||
|| flavor == FLAVOR::PDFLATEX
|
|| flavor == Flavor::PdfLaTeX
|
||||||
|| flavor == FLAVOR::XETEX;
|
|| flavor == Flavor::XeTeX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool OutputParams::isFullUnicode() const
|
bool OutputParams::isFullUnicode() const
|
||||||
{
|
{
|
||||||
return flavor == FLAVOR::LUATEX
|
return flavor == Flavor::LuaTeX
|
||||||
|| flavor == FLAVOR::DVILUATEX
|
|| flavor == Flavor::DviLuaTeX
|
||||||
|| flavor == FLAVOR::XETEX;
|
|| flavor == Flavor::XeTeX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool OutputParams::useBidiPackage() const
|
bool OutputParams::useBidiPackage() const
|
||||||
{
|
{
|
||||||
return use_polyglossia && flavor == FLAVOR::XETEX;
|
return use_polyglossia && flavor == Flavor::XeTeX;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace lyx
|
} // namespace lyx
|
||||||
|
@ -29,16 +29,16 @@ class Language;
|
|||||||
class InsetArgument;
|
class InsetArgument;
|
||||||
|
|
||||||
|
|
||||||
enum class FLAVOR : int {
|
enum class Flavor : int {
|
||||||
DVILUATEX,
|
DviLuaTeX,
|
||||||
LATEX,
|
LaTeX,
|
||||||
LUATEX,
|
LuaTeX,
|
||||||
PDFLATEX,
|
PdfLaTeX,
|
||||||
XETEX,
|
XeTeX,
|
||||||
DOCBOOK5,
|
DocBook5,
|
||||||
HTML,
|
Html,
|
||||||
TEXT,
|
Text,
|
||||||
LYX
|
LyX
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class CtObject : int {
|
enum class CtObject : int {
|
||||||
@ -78,7 +78,7 @@ public:
|
|||||||
/** The file that we export depends occasionally on what is to
|
/** The file that we export depends occasionally on what is to
|
||||||
compile the file.
|
compile the file.
|
||||||
*/
|
*/
|
||||||
FLAVOR flavor = FLAVOR::LATEX;
|
Flavor flavor = Flavor::LaTeX;
|
||||||
/// is it some flavor of LaTeX?
|
/// is it some flavor of LaTeX?
|
||||||
bool isLaTeX() const;
|
bool isLaTeX() const;
|
||||||
/// does this flavour support full unicode?
|
/// does this flavour support full unicode?
|
||||||
|
@ -191,7 +191,7 @@ void PDFOptions::writeLaTeX(OutputParams & runparams, otexstream & os,
|
|||||||
// this if the current input encoding does not support a character.
|
// this if the current input encoding does not support a character.
|
||||||
// FIXME: don't use \inputencoding if "inputenc" is not loaded (#9839).
|
// FIXME: don't use \inputencoding if "inputenc" is not loaded (#9839).
|
||||||
if (need_unicode && enc && enc->iconvName() != "UTF-8") {
|
if (need_unicode && enc && enc->iconvName() != "UTF-8") {
|
||||||
if (runparams.flavor != FLAVOR::XETEX)
|
if (runparams.flavor != Flavor::XeTeX)
|
||||||
os << "\\inputencoding{utf8}\n";
|
os << "\\inputencoding{utf8}\n";
|
||||||
os << setEncoding("UTF-8");
|
os << setEncoding("UTF-8");
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ void PDFOptions::writeLaTeX(OutputParams & runparams, otexstream & os,
|
|||||||
os << from_utf8(opt);
|
os << from_utf8(opt);
|
||||||
if (need_unicode && enc && enc->iconvName() != "UTF-8") {
|
if (need_unicode && enc && enc->iconvName() != "UTF-8") {
|
||||||
os << setEncoding(enc->iconvName());
|
os << setEncoding(enc->iconvName());
|
||||||
if (runparams.flavor != FLAVOR::XETEX)
|
if (runparams.flavor != Flavor::XeTeX)
|
||||||
os << "\\inputencoding{" << from_ascii(enc->latexName()) << "}\n";
|
os << "\\inputencoding{" << from_ascii(enc->latexName()) << "}\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1236,7 +1236,7 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
|
|||||||
&& !runparams.inIPA
|
&& !runparams.inIPA
|
||||||
// TODO #10961: && not in inset Flex Code
|
// TODO #10961: && not in inset Flex Code
|
||||||
// TODO #10961: && not in layout LyXCode
|
// TODO #10961: && not in layout LyXCode
|
||||||
&& (!bparams.useNonTeXFonts || runparams.flavor != FLAVOR::XETEX)) {
|
&& (!bparams.useNonTeXFonts || runparams.flavor != Flavor::XeTeX)) {
|
||||||
if (c == 0x2013) {
|
if (c == 0x2013) {
|
||||||
// en-dash
|
// en-dash
|
||||||
os << "--";
|
os << "--";
|
||||||
@ -1390,7 +1390,7 @@ void Paragraph::Private::validate(LaTeXFeatures & features) const
|
|||||||
features.addPreambleSnippet(os.release(), true);
|
features.addPreambleSnippet(os.release(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (features.runparams().flavor == FLAVOR::HTML
|
if (features.runparams().flavor == Flavor::Html
|
||||||
&& layout_->htmltitle()) {
|
&& layout_->htmltitle()) {
|
||||||
features.setHTMLTitle(owner_->asString(AS_STR_INSETS | AS_STR_SKIPDELETE));
|
features.setHTMLTitle(owner_->asString(AS_STR_INSETS | AS_STR_SKIPDELETE));
|
||||||
}
|
}
|
||||||
@ -1485,7 +1485,7 @@ void Paragraph::Private::validate(LaTeXFeatures & features) const
|
|||||||
} else if (!bp.use_dash_ligatures
|
} else if (!bp.use_dash_ligatures
|
||||||
&& (c == 0x2013 || c == 0x2014)
|
&& (c == 0x2013 || c == 0x2014)
|
||||||
&& bp.useNonTeXFonts
|
&& bp.useNonTeXFonts
|
||||||
&& features.runparams().flavor == FLAVOR::XETEX)
|
&& features.runparams().flavor == Flavor::XeTeX)
|
||||||
// XeTeX's dash behaviour is determined via a global setting
|
// XeTeX's dash behaviour is determined via a global setting
|
||||||
features.require("xetexdashbreakstate");
|
features.require("xetexdashbreakstate");
|
||||||
BufferEncodings::validate(c, features);
|
BufferEncodings::validate(c, features);
|
||||||
|
@ -1782,7 +1782,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
QuoteLevel const quote_level = inner
|
QuoteLevel const quote_level = inner
|
||||||
? QuoteLevel::SecondaryQuotes : QuoteLevel::PrimaryQuotes;
|
? QuoteLevel::Secondary : QuoteLevel::Primary;
|
||||||
cur.insert(new InsetQuotes(cur.buffer(), c, quote_level, cmd.getArg(1), cmd.getArg(2)));
|
cur.insert(new InsetQuotes(cur.buffer(), c, quote_level, cmd.getArg(1), cmd.getArg(2)));
|
||||||
cur.buffer()->updateBuffer();
|
cur.buffer()->updateBuffer();
|
||||||
cur.posForward();
|
cur.posForward();
|
||||||
|
@ -91,12 +91,12 @@ QString Dialog::bufferFilePath() const
|
|||||||
KernelDocType Dialog::docType() const
|
KernelDocType Dialog::docType() const
|
||||||
{
|
{
|
||||||
if (buffer().params().isLatex())
|
if (buffer().params().isLatex())
|
||||||
return KernelDocType::LATEX;
|
return KernelDocType::LaTeX;
|
||||||
if (buffer().params().isLiterate())
|
if (buffer().params().isLiterate())
|
||||||
return KernelDocType::LITERATE;
|
return KernelDocType::Literate;
|
||||||
|
|
||||||
// This case should not happen.
|
// This case should not happen.
|
||||||
return KernelDocType::LATEX;
|
return KernelDocType::LaTeX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,8 +40,8 @@ class GuiView;
|
|||||||
*/
|
*/
|
||||||
enum class KernelDocType : int
|
enum class KernelDocType : int
|
||||||
{
|
{
|
||||||
LATEX,
|
LaTeX,
|
||||||
LITERATE
|
Literate
|
||||||
};
|
};
|
||||||
|
|
||||||
/** \c Dialog collects the different parts of a Model-Controller-View
|
/** \c Dialog collects the different parts of a Model-Controller-View
|
||||||
|
@ -2267,7 +2267,7 @@ void GuiDocument::updateQuoteStyles(bool const set)
|
|||||||
bool has_default = false;
|
bool has_default = false;
|
||||||
for (int i = 0; i < quoteparams.stylescount(); ++i) {
|
for (int i = 0; i < quoteparams.stylescount(); ++i) {
|
||||||
QuoteStyle qs = QuoteStyle(i);
|
QuoteStyle qs = QuoteStyle(i);
|
||||||
if (qs == QuoteStyle::DynamicQuotes)
|
if (qs == QuoteStyle::Dynamic)
|
||||||
continue;
|
continue;
|
||||||
bool const langdef = (qs == def);
|
bool const langdef = (qs == def);
|
||||||
if (langdef) {
|
if (langdef) {
|
||||||
|
@ -234,7 +234,7 @@ QValidator::State PathValidator::validate(QString & qtext, int &) const
|
|||||||
|
|
||||||
void PathValidator::setChecker(KernelDocType const & type, LyXRC const & rc)
|
void PathValidator::setChecker(KernelDocType const & type, LyXRC const & rc)
|
||||||
{
|
{
|
||||||
latex_doc_ = type == KernelDocType::LATEX;
|
latex_doc_ = type == KernelDocType::LaTeX;
|
||||||
tex_allows_spaces_ = rc.tex_allows_spaces;
|
tex_allows_spaces_ = rc.tex_allows_spaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ private:
|
|||||||
/// Called by the ForkedCall process that generated the bitmap files.
|
/// Called by the ForkedCall process that generated the bitmap files.
|
||||||
void finishedGenerating(pid_t, int);
|
void finishedGenerating(pid_t, int);
|
||||||
///
|
///
|
||||||
void dumpPreamble(otexstream &, FLAVOR) const;
|
void dumpPreamble(otexstream &, Flavor) const;
|
||||||
///
|
///
|
||||||
void dumpData(odocstream &, BitmapFile const &) const;
|
void dumpData(odocstream &, BitmapFile const &) const;
|
||||||
|
|
||||||
@ -637,37 +637,37 @@ void PreviewLoader::Impl::startLoading(bool wait)
|
|||||||
&& buffer_.params().default_output_format != "default";
|
&& buffer_.params().default_output_format != "default";
|
||||||
// Use LATEX flavor if the document does not specify a specific
|
// Use LATEX flavor if the document does not specify a specific
|
||||||
// output format (see bug 9371).
|
// output format (see bug 9371).
|
||||||
FLAVOR flavor = docformat
|
Flavor flavor = docformat
|
||||||
? buffer_.params().getOutputFlavor()
|
? buffer_.params().getOutputFlavor()
|
||||||
: FLAVOR::LATEX;
|
: Flavor::LaTeX;
|
||||||
if (buffer_.params().encoding().package() == Encoding::japanese) {
|
if (buffer_.params().encoding().package() == Encoding::japanese) {
|
||||||
latexparam = " --latex=platex";
|
latexparam = " --latex=platex";
|
||||||
flavor = FLAVOR::LATEX;
|
flavor = Flavor::LaTeX;
|
||||||
}
|
}
|
||||||
else if (buffer_.params().useNonTeXFonts) {
|
else if (buffer_.params().useNonTeXFonts) {
|
||||||
if (flavor == FLAVOR::LUATEX)
|
if (flavor == Flavor::LuaTeX)
|
||||||
latexparam = " --latex=lualatex";
|
latexparam = " --latex=lualatex";
|
||||||
else {
|
else {
|
||||||
flavor = FLAVOR::XETEX;
|
flavor = Flavor::XeTeX;
|
||||||
latexparam = " --latex=xelatex";
|
latexparam = " --latex=xelatex";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (flavor) {
|
switch (flavor) {
|
||||||
case FLAVOR::PDFLATEX:
|
case Flavor::PdfLaTeX:
|
||||||
latexparam = " --latex=pdflatex";
|
latexparam = " --latex=pdflatex";
|
||||||
break;
|
break;
|
||||||
case FLAVOR::XETEX:
|
case Flavor::XeTeX:
|
||||||
latexparam = " --latex=xelatex";
|
latexparam = " --latex=xelatex";
|
||||||
break;
|
break;
|
||||||
case FLAVOR::LUATEX:
|
case Flavor::LuaTeX:
|
||||||
latexparam = " --latex=lualatex";
|
latexparam = " --latex=lualatex";
|
||||||
break;
|
break;
|
||||||
case FLAVOR::DVILUATEX:
|
case Flavor::DviLuaTeX:
|
||||||
latexparam = " --latex=dvilualatex";
|
latexparam = " --latex=dvilualatex";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
flavor = FLAVOR::LATEX;
|
flavor = Flavor::LaTeX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dumpPreamble(os, flavor);
|
dumpPreamble(os, flavor);
|
||||||
@ -811,7 +811,7 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PreviewLoader::Impl::dumpPreamble(otexstream & os, FLAVOR flavor) const
|
void PreviewLoader::Impl::dumpPreamble(otexstream & os, Flavor flavor) const
|
||||||
{
|
{
|
||||||
// Dump the preamble only.
|
// Dump the preamble only.
|
||||||
LYXERR(Debug::LATEX, "dumpPreamble, flavor == " << static_cast<int>(flavor));
|
LYXERR(Debug::LATEX, "dumpPreamble, flavor == " << static_cast<int>(flavor));
|
||||||
|
@ -906,7 +906,7 @@ void InsetBibtex::validate(LaTeXFeatures & features) const
|
|||||||
// FIXME XHTML
|
// FIXME XHTML
|
||||||
// It'd be better to be able to get this from an InsetLayout, but at present
|
// It'd be better to be able to get this from an InsetLayout, but at present
|
||||||
// InsetLayouts do not seem really to work for things that aren't InsetTexts.
|
// InsetLayouts do not seem really to work for things that aren't InsetTexts.
|
||||||
if (features.runparams().flavor == FLAVOR::HTML)
|
if (features.runparams().flavor == Flavor::Html)
|
||||||
features.addCSSSnippet("div.bibtexentry { margin-left: 2em; text-indent: -2em; }\n"
|
features.addCSSSnippet("div.bibtexentry { margin-left: 2em; text-indent: -2em; }\n"
|
||||||
"span.bibtexlabel:before{ content: \"[\"; }\n"
|
"span.bibtexlabel:before{ content: \"[\"; }\n"
|
||||||
"span.bibtexlabel:after{ content: \"] \"; }");
|
"span.bibtexlabel:after{ content: \"] \"; }");
|
||||||
|
@ -569,7 +569,7 @@ static docstring latexString(InsetExternal const & inset)
|
|||||||
// We don't need to set runparams.encoding since it is not used by
|
// We don't need to set runparams.encoding since it is not used by
|
||||||
// latex().
|
// latex().
|
||||||
OutputParams runparams(0);
|
OutputParams runparams(0);
|
||||||
runparams.flavor = FLAVOR::LATEX;
|
runparams.flavor = Flavor::LaTeX;
|
||||||
inset.latex(os, runparams);
|
inset.latex(os, runparams);
|
||||||
return ods.str();
|
return ods.str();
|
||||||
}
|
}
|
||||||
@ -712,7 +712,7 @@ void InsetExternal::latex(otexstream & os, OutputParams const & runparams) const
|
|||||||
|
|
||||||
// If the template has specified a PDFLaTeX output, then we try and
|
// If the template has specified a PDFLaTeX output, then we try and
|
||||||
// use that.
|
// use that.
|
||||||
if (runparams.flavor == FLAVOR::PDFLATEX) {
|
if (runparams.flavor == Flavor::PdfLaTeX) {
|
||||||
external::Template const * const et_ptr =
|
external::Template const * const et_ptr =
|
||||||
external::getTemplatePtr(params_);
|
external::getTemplatePtr(params_);
|
||||||
if (!et_ptr)
|
if (!et_ptr)
|
||||||
@ -815,25 +815,25 @@ void InsetExternal::validate(LaTeXFeatures & features) const
|
|||||||
|
|
||||||
string format;
|
string format;
|
||||||
switch (features.runparams().flavor) {
|
switch (features.runparams().flavor) {
|
||||||
case FLAVOR::LATEX:
|
case Flavor::LaTeX:
|
||||||
case FLAVOR::DVILUATEX:
|
case Flavor::DviLuaTeX:
|
||||||
format = "LaTeX";
|
format = "LaTeX";
|
||||||
break;
|
break;
|
||||||
case FLAVOR::LUATEX:
|
case Flavor::LuaTeX:
|
||||||
case FLAVOR::PDFLATEX:
|
case Flavor::PdfLaTeX:
|
||||||
case FLAVOR::XETEX:
|
case Flavor::XeTeX:
|
||||||
format = "PDFLaTeX";
|
format = "PDFLaTeX";
|
||||||
break;
|
break;
|
||||||
case FLAVOR::DOCBOOK5:
|
case Flavor::DocBook5:
|
||||||
format = "DocBook";
|
format = "DocBook";
|
||||||
break;
|
break;
|
||||||
case FLAVOR::HTML:
|
case Flavor::Html:
|
||||||
format = "html";
|
format = "html";
|
||||||
break;
|
break;
|
||||||
case FLAVOR::TEXT:
|
case Flavor::Text:
|
||||||
format = "text";
|
format = "text";
|
||||||
break;
|
break;
|
||||||
case FLAVOR::LYX:
|
case Flavor::LyX:
|
||||||
format = "lyx";
|
format = "lyx";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -111,9 +111,9 @@ namespace {
|
|||||||
string findTargetFormat(string const & format, OutputParams const & runparams)
|
string findTargetFormat(string const & format, OutputParams const & runparams)
|
||||||
{
|
{
|
||||||
// Are we latexing to DVI or PDF?
|
// Are we latexing to DVI or PDF?
|
||||||
if (runparams.flavor == FLAVOR::PDFLATEX
|
if (runparams.flavor == Flavor::PdfLaTeX
|
||||||
|| runparams.flavor == FLAVOR::XETEX
|
|| runparams.flavor == Flavor::XeTeX
|
||||||
|| runparams.flavor == FLAVOR::LUATEX) {
|
|| runparams.flavor == Flavor::LuaTeX) {
|
||||||
LYXERR(Debug::GRAPHICS, "findTargetFormat: PDF mode");
|
LYXERR(Debug::GRAPHICS, "findTargetFormat: PDF mode");
|
||||||
Format const * const f = theFormats().getFormat(format);
|
Format const * const f = theFormats().getFormat(format);
|
||||||
// Convert vector graphics to pdf
|
// Convert vector graphics to pdf
|
||||||
@ -127,7 +127,7 @@ string findTargetFormat(string const & format, OutputParams const & runparams)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// for HTML and DocBook, we leave the known formats and otherwise convert to png
|
// for HTML and DocBook, we leave the known formats and otherwise convert to png
|
||||||
if (runparams.flavor == FLAVOR::HTML || runparams.flavor == FLAVOR::DOCBOOK5) {
|
if (runparams.flavor == Flavor::Html || runparams.flavor == Flavor::DocBook5) {
|
||||||
Format const * const f = theFormats().getFormat(format);
|
Format const * const f = theFormats().getFormat(format);
|
||||||
// Convert vector graphics to svg
|
// Convert vector graphics to svg
|
||||||
if (f && f->vectorFormat() && theConverters().isReachable(format, "svg"))
|
if (f && f->vectorFormat() && theConverters().isReachable(format, "svg"))
|
||||||
@ -696,7 +696,7 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
|
|||||||
}
|
}
|
||||||
// only show DVI-specific warning when export format is plain latex
|
// only show DVI-specific warning when export format is plain latex
|
||||||
if (!isValidDVIFileName(output_file)
|
if (!isValidDVIFileName(output_file)
|
||||||
&& runparams.flavor == FLAVOR::LATEX) {
|
&& runparams.flavor == Flavor::LaTeX) {
|
||||||
frontend::Alert::warning(_("Problematic filename for DVI"),
|
frontend::Alert::warning(_("Problematic filename for DVI"),
|
||||||
_("The following filename can cause troubles "
|
_("The following filename can cause troubles "
|
||||||
"when running the exported file through LaTeX "
|
"when running the exported file through LaTeX "
|
||||||
@ -844,8 +844,8 @@ void InsetGraphics::latex(otexstream & os,
|
|||||||
string after;
|
string after;
|
||||||
|
|
||||||
// Write the options if there are any.
|
// Write the options if there are any.
|
||||||
bool const ps = runparams.flavor == FLAVOR::LATEX
|
bool const ps = runparams.flavor == Flavor::LaTeX
|
||||||
|| runparams.flavor == FLAVOR::DVILUATEX;
|
|| runparams.flavor == Flavor::DviLuaTeX;
|
||||||
string const opts = createLatexOptions(ps);
|
string const opts = createLatexOptions(ps);
|
||||||
LYXERR(Debug::GRAPHICS, "\tOpts = " << opts);
|
LYXERR(Debug::GRAPHICS, "\tOpts = " << opts);
|
||||||
|
|
||||||
|
@ -1290,7 +1290,7 @@ docstring latexString(InsetInclude const & inset)
|
|||||||
// We don't need to set runparams.encoding since this will be done
|
// We don't need to set runparams.encoding since this will be done
|
||||||
// by latex() anyway.
|
// by latex() anyway.
|
||||||
OutputParams runparams(nullptr);
|
OutputParams runparams(nullptr);
|
||||||
runparams.flavor = FLAVOR::LATEX;
|
runparams.flavor = Flavor::LaTeX;
|
||||||
runparams.for_preview = true;
|
runparams.for_preview = true;
|
||||||
inset.latex(os, runparams);
|
inset.latex(os, runparams);
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ void InsetNote::validate(LaTeXFeatures & features) const
|
|||||||
{
|
{
|
||||||
switch (params_.type) {
|
switch (params_.type) {
|
||||||
case InsetNoteParams::Comment:
|
case InsetNoteParams::Comment:
|
||||||
if (features.runparams().flavor == FLAVOR::HTML)
|
if (features.runparams().flavor == Flavor::Html)
|
||||||
// we do output this but set display to "none" by default,
|
// we do output this but set display to "none" by default,
|
||||||
// but people might want to use it.
|
// but people might want to use it.
|
||||||
InsetCollapsible::validate(features);
|
InsetCollapsible::validate(features);
|
||||||
|
@ -122,7 +122,7 @@ QuoteStyle InsetQuotesParams::getQuoteStyle(string const & s,
|
|||||||
if (i >= stylescount()) {
|
if (i >= stylescount()) {
|
||||||
LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
|
LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
|
||||||
" bad style specification.");
|
" bad style specification.");
|
||||||
res = QuoteStyle::EnglishQuotes;
|
res = QuoteStyle::English;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ QuoteSide InsetQuotesParams::getQuoteSide(string const & s,
|
|||||||
if (i >= 2) {
|
if (i >= 2) {
|
||||||
LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
|
LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
|
||||||
" bad side specification.");
|
" bad side specification.");
|
||||||
res = QuoteSide::OpeningQuote;
|
res = QuoteSide::Opening;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ QuoteLevel InsetQuotesParams::getQuoteLevel(string const & s,
|
|||||||
if (i >= 2) {
|
if (i >= 2) {
|
||||||
LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
|
LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
|
||||||
" bad level specification.");
|
" bad level specification.");
|
||||||
res = QuoteLevel::PrimaryQuotes;
|
res = QuoteLevel::Primary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,105 +207,105 @@ char_type InsetQuotesParams::getQuoteChar(QuoteStyle const & style, QuoteLevel c
|
|||||||
char_type right_secondary;
|
char_type right_secondary;
|
||||||
|
|
||||||
switch (style) {
|
switch (style) {
|
||||||
case QuoteStyle::EnglishQuotes: {
|
case QuoteStyle::English: {
|
||||||
left_primary = 0x201c; // ``
|
left_primary = 0x201c; // ``
|
||||||
right_primary = 0x201d; // ''
|
right_primary = 0x201d; // ''
|
||||||
left_secondary = 0x2018; // `
|
left_secondary = 0x2018; // `
|
||||||
right_secondary = 0x2019; // '
|
right_secondary = 0x2019; // '
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::SwedishQuotes: {
|
case QuoteStyle::Swedish: {
|
||||||
left_primary = 0x201d; // ''
|
left_primary = 0x201d; // ''
|
||||||
right_primary = 0x201d; // ''
|
right_primary = 0x201d; // ''
|
||||||
left_secondary = 0x2019; // '
|
left_secondary = 0x2019; // '
|
||||||
right_secondary = 0x2019; // '
|
right_secondary = 0x2019; // '
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::GermanQuotes: {
|
case QuoteStyle::German: {
|
||||||
left_primary = 0x201e; // ,,
|
left_primary = 0x201e; // ,,
|
||||||
right_primary = 0x201c; // ``
|
right_primary = 0x201c; // ``
|
||||||
left_secondary = 0x201a; // ,
|
left_secondary = 0x201a; // ,
|
||||||
right_secondary = 0x2018; // `
|
right_secondary = 0x2018; // `
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::PolishQuotes: {
|
case QuoteStyle::Polish: {
|
||||||
left_primary = 0x201e; // ,,
|
left_primary = 0x201e; // ,,
|
||||||
right_primary = 0x201d; // ''
|
right_primary = 0x201d; // ''
|
||||||
left_secondary = 0x201a; // ,
|
left_secondary = 0x201a; // ,
|
||||||
right_secondary = 0x2019; // '
|
right_secondary = 0x2019; // '
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::SwissQuotes: {
|
case QuoteStyle::Swiss: {
|
||||||
left_primary = 0x00ab; // <<
|
left_primary = 0x00ab; // <<
|
||||||
right_primary = 0x00bb; // >>
|
right_primary = 0x00bb; // >>
|
||||||
left_secondary = 0x2039; // <
|
left_secondary = 0x2039; // <
|
||||||
right_secondary = 0x203a; // >
|
right_secondary = 0x203a; // >
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::DanishQuotes: {
|
case QuoteStyle::Danish: {
|
||||||
left_primary = 0x00bb; // >>
|
left_primary = 0x00bb; // >>
|
||||||
right_primary = 0x00ab; // <<
|
right_primary = 0x00ab; // <<
|
||||||
left_secondary = 0x203a; // >
|
left_secondary = 0x203a; // >
|
||||||
right_secondary = 0x2039; // <
|
right_secondary = 0x2039; // <
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::PlainQuotes: {
|
case QuoteStyle::Plain: {
|
||||||
left_primary = 0x0022; // "
|
left_primary = 0x0022; // "
|
||||||
right_primary = 0x0022; // "
|
right_primary = 0x0022; // "
|
||||||
left_secondary = 0x0027; // '
|
left_secondary = 0x0027; // '
|
||||||
right_secondary = 0x0027; // '
|
right_secondary = 0x0027; // '
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::BritishQuotes: {
|
case QuoteStyle::British: {
|
||||||
left_primary = 0x2018; // `
|
left_primary = 0x2018; // `
|
||||||
right_primary = 0x2019; // '
|
right_primary = 0x2019; // '
|
||||||
left_secondary = 0x201c; // ``
|
left_secondary = 0x201c; // ``
|
||||||
right_secondary = 0x201d; // ''
|
right_secondary = 0x201d; // ''
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::SwedishGQuotes: {
|
case QuoteStyle::SwedishG: {
|
||||||
left_primary = 0x00bb; // >>
|
left_primary = 0x00bb; // >>
|
||||||
right_primary = 0x00bb; // >>
|
right_primary = 0x00bb; // >>
|
||||||
left_secondary = 0x2019; // '
|
left_secondary = 0x2019; // '
|
||||||
right_secondary = 0x2019; // '
|
right_secondary = 0x2019; // '
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::FrenchQuotes: {
|
case QuoteStyle::French: {
|
||||||
left_primary = 0x00ab; // <<
|
left_primary = 0x00ab; // <<
|
||||||
right_primary = 0x00bb; // >>
|
right_primary = 0x00bb; // >>
|
||||||
left_secondary = 0x201c; // ``
|
left_secondary = 0x201c; // ``
|
||||||
right_secondary = 0x201d; // ''
|
right_secondary = 0x201d; // ''
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::FrenchINQuotes:{
|
case QuoteStyle::FrenchIN:{
|
||||||
left_primary = 0x00ab; // <<
|
left_primary = 0x00ab; // <<
|
||||||
right_primary = 0x00bb; // >>
|
right_primary = 0x00bb; // >>
|
||||||
left_secondary = 0x00ab; // <<
|
left_secondary = 0x00ab; // <<
|
||||||
right_secondary = 0x00bb; // >>
|
right_secondary = 0x00bb; // >>
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::RussianQuotes:{
|
case QuoteStyle::Russian:{
|
||||||
left_primary = 0x00ab; // <<
|
left_primary = 0x00ab; // <<
|
||||||
right_primary = 0x00bb; // >>
|
right_primary = 0x00bb; // >>
|
||||||
left_secondary = 0x201e; // ,,
|
left_secondary = 0x201e; // ,,
|
||||||
right_secondary = 0x201c; // ``
|
right_secondary = 0x201c; // ``
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::CJKQuotes:{
|
case QuoteStyle::CJK:{
|
||||||
left_primary = 0x300c; // LEFT CORNER BRACKET
|
left_primary = 0x300c; // LEFT CORNER BRACKET
|
||||||
right_primary = 0x300d; // RIGHT CORNER BRACKET
|
right_primary = 0x300d; // RIGHT CORNER BRACKET
|
||||||
left_secondary = 0x300e; // LEFT WHITE CORNER BRACKET
|
left_secondary = 0x300e; // LEFT WHITE CORNER BRACKET
|
||||||
right_secondary = 0x300f; // RIGHT WHITE CORNER BRACKET
|
right_secondary = 0x300f; // RIGHT WHITE CORNER BRACKET
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::CJKAngleQuotes:{
|
case QuoteStyle::CJKAngle:{
|
||||||
left_primary = 0x300a; // LEFT DOUBLE ANGLE BRACKET
|
left_primary = 0x300a; // LEFT DOUBLE ANGLE BRACKET
|
||||||
right_primary = 0x300b; // RIGHT DOUBLE ANGLE BRACKET
|
right_primary = 0x300b; // RIGHT DOUBLE ANGLE BRACKET
|
||||||
left_secondary = 0x3008; // LEFT ANGLE BRACKET
|
left_secondary = 0x3008; // LEFT ANGLE BRACKET
|
||||||
right_secondary = 0x3009; // RIGHT ANGLE BRACKET
|
right_secondary = 0x3009; // RIGHT ANGLE BRACKET
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuoteStyle::DynamicQuotes:
|
case QuoteStyle::Dynamic:
|
||||||
default:
|
default:
|
||||||
// should not happen
|
// should not happen
|
||||||
left_primary = 0x003f; // ?
|
left_primary = 0x003f; // ?
|
||||||
@ -316,14 +316,14 @@ char_type InsetQuotesParams::getQuoteChar(QuoteStyle const & style, QuoteLevel c
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case QuoteLevel::SecondaryQuotes:
|
case QuoteLevel::Secondary:
|
||||||
if (rtl)
|
if (rtl)
|
||||||
return (side == QuoteSide::ClosingQuote) ? left_secondary : right_secondary;
|
return (side == QuoteSide::Closing) ? left_secondary : right_secondary;
|
||||||
return (side == QuoteSide::OpeningQuote) ? left_secondary : right_secondary;
|
return (side == QuoteSide::Opening) ? left_secondary : right_secondary;
|
||||||
case QuoteLevel::PrimaryQuotes:
|
case QuoteLevel::Primary:
|
||||||
if (rtl)
|
if (rtl)
|
||||||
return (side == QuoteSide::ClosingQuote) ? left_primary : right_primary;
|
return (side == QuoteSide::Closing) ? left_primary : right_primary;
|
||||||
return (side == QuoteSide::OpeningQuote) ? left_primary : right_primary;
|
return (side == QuoteSide::Opening) ? left_primary : right_primary;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -555,7 +555,7 @@ map<string, docstring> InsetQuotesParams::getTypes() const
|
|||||||
// get all quote types
|
// get all quote types
|
||||||
for (sty = 0; sty < stylescount(); ++sty) {
|
for (sty = 0; sty < stylescount(); ++sty) {
|
||||||
style = QuoteStyle(sty);
|
style = QuoteStyle(sty);
|
||||||
if (style == QuoteStyle::DynamicQuotes)
|
if (style == QuoteStyle::Dynamic)
|
||||||
continue;
|
continue;
|
||||||
for (sid = 0; sid < 2; ++sid) {
|
for (sid = 0; sid < 2; ++sid) {
|
||||||
side = QuoteSide(sid);
|
side = QuoteSide(sid);
|
||||||
@ -577,10 +577,10 @@ docstring const InsetQuotesParams::getGuiLabel(QuoteStyle const & qs, bool langd
|
|||||||
{
|
{
|
||||||
docstring const styledesc =
|
docstring const styledesc =
|
||||||
bformat(_("%1$souter%2$s and %3$sinner%4$s[[quotation marks]]"),
|
bformat(_("%1$souter%2$s and %3$sinner%4$s[[quotation marks]]"),
|
||||||
docstring(1, getQuoteChar(qs, QuoteLevel::PrimaryQuotes, QuoteSide::OpeningQuote)),
|
docstring(1, getQuoteChar(qs, QuoteLevel::Primary, QuoteSide::Opening)),
|
||||||
docstring(1, getQuoteChar(qs, QuoteLevel::PrimaryQuotes, QuoteSide::ClosingQuote)),
|
docstring(1, getQuoteChar(qs, QuoteLevel::Primary, QuoteSide::Closing)),
|
||||||
docstring(1, getQuoteChar(qs, QuoteLevel::SecondaryQuotes, QuoteSide::OpeningQuote)),
|
docstring(1, getQuoteChar(qs, QuoteLevel::Secondary, QuoteSide::Opening)),
|
||||||
docstring(1, getQuoteChar(qs, QuoteLevel::SecondaryQuotes, QuoteSide::ClosingQuote))
|
docstring(1, getQuoteChar(qs, QuoteLevel::Secondary, QuoteSide::Closing))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!langdef)
|
if (!langdef)
|
||||||
@ -598,7 +598,7 @@ docstring const InsetQuotesParams::getShortGuiLabel(docstring const & str) const
|
|||||||
QuoteSide const side = getQuoteSide(s);
|
QuoteSide const side = getQuoteSide(s);
|
||||||
QuoteLevel const level = getQuoteLevel(s);
|
QuoteLevel const level = getQuoteLevel(s);
|
||||||
|
|
||||||
return (side == QuoteSide::OpeningQuote) ?
|
return (side == QuoteSide::Opening) ?
|
||||||
bformat(_("%1$stext"),
|
bformat(_("%1$stext"),
|
||||||
docstring(1, getQuoteChar(style, level, side))) :
|
docstring(1, getQuoteChar(style, level, side))) :
|
||||||
bformat(_("text%1$s"),
|
bformat(_("text%1$s"),
|
||||||
@ -638,14 +638,14 @@ InsetQuotes::InsetQuotes(Buffer * buf, char_type c, QuoteLevel level,
|
|||||||
fontenc_ = "OT1";
|
fontenc_ = "OT1";
|
||||||
}
|
}
|
||||||
if (style.empty())
|
if (style.empty())
|
||||||
style_ = dynamic ? QuoteStyle::DynamicQuotes : global_style_;
|
style_ = dynamic ? QuoteStyle::Dynamic : global_style_;
|
||||||
else
|
else
|
||||||
style_ = getStyle(style);
|
style_ = getStyle(style);
|
||||||
|
|
||||||
if (side == "left" || side == "opening")
|
if (side == "left" || side == "opening")
|
||||||
side_ = QuoteSide::OpeningQuote;
|
side_ = QuoteSide::Opening;
|
||||||
else if (side == "right" || side == "closing")
|
else if (side == "right" || side == "closing")
|
||||||
side_ = QuoteSide::ClosingQuote;
|
side_ = QuoteSide::Closing;
|
||||||
else
|
else
|
||||||
setSide(c);
|
setSide(c);
|
||||||
}
|
}
|
||||||
@ -661,9 +661,9 @@ void InsetQuotes::setSide(char_type c)
|
|||||||
{
|
{
|
||||||
// Decide whether opening or closing quote
|
// Decide whether opening or closing quote
|
||||||
if (lyx::isSpace(c) || isOpenPunctuation(c))
|
if (lyx::isSpace(c) || isOpenPunctuation(c))
|
||||||
side_ = QuoteSide::OpeningQuote;// opening quote
|
side_ = QuoteSide::Opening;// opening quote
|
||||||
else
|
else
|
||||||
side_ = QuoteSide::ClosingQuote;// closing quote
|
side_ = QuoteSide::Closing;// closing quote
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -677,38 +677,38 @@ void InsetQuotes::parseString(string const & s, bool const allow_wildcards)
|
|||||||
|
|
||||||
QuoteStyle InsetQuotes::getStyle(string const & s)
|
QuoteStyle InsetQuotes::getStyle(string const & s)
|
||||||
{
|
{
|
||||||
QuoteStyle qs = QuoteStyle::EnglishQuotes;
|
QuoteStyle qs = QuoteStyle::English;
|
||||||
|
|
||||||
if (s == "english")
|
if (s == "english")
|
||||||
qs = QuoteStyle::EnglishQuotes;
|
qs = QuoteStyle::English;
|
||||||
else if (s == "swedish")
|
else if (s == "swedish")
|
||||||
qs = QuoteStyle::SwedishQuotes;
|
qs = QuoteStyle::Swedish;
|
||||||
else if (s == "german")
|
else if (s == "german")
|
||||||
qs = QuoteStyle::GermanQuotes;
|
qs = QuoteStyle::German;
|
||||||
else if (s == "polish")
|
else if (s == "polish")
|
||||||
qs = QuoteStyle::PolishQuotes;
|
qs = QuoteStyle::Polish;
|
||||||
else if (s == "swiss")
|
else if (s == "swiss")
|
||||||
qs = QuoteStyle::SwissQuotes;
|
qs = QuoteStyle::Swiss;
|
||||||
else if (s == "danish")
|
else if (s == "danish")
|
||||||
qs = QuoteStyle::DanishQuotes;
|
qs = QuoteStyle::Danish;
|
||||||
else if (s == "plain")
|
else if (s == "plain")
|
||||||
qs = QuoteStyle::PlainQuotes;
|
qs = QuoteStyle::Plain;
|
||||||
else if (s == "british")
|
else if (s == "british")
|
||||||
qs = QuoteStyle::BritishQuotes;
|
qs = QuoteStyle::British;
|
||||||
else if (s == "swedishg")
|
else if (s == "swedishg")
|
||||||
qs = QuoteStyle::SwedishGQuotes;
|
qs = QuoteStyle::SwedishG;
|
||||||
else if (s == "french")
|
else if (s == "french")
|
||||||
qs = QuoteStyle::FrenchQuotes;
|
qs = QuoteStyle::French;
|
||||||
else if (s == "frenchin")
|
else if (s == "frenchin")
|
||||||
qs = QuoteStyle::FrenchINQuotes;
|
qs = QuoteStyle::FrenchIN;
|
||||||
else if (s == "russian")
|
else if (s == "russian")
|
||||||
qs = QuoteStyle::RussianQuotes;
|
qs = QuoteStyle::Russian;
|
||||||
else if (s == "cjk")
|
else if (s == "cjk")
|
||||||
qs = QuoteStyle::CJKQuotes;
|
qs = QuoteStyle::CJK;
|
||||||
else if (s == "cjkangle")
|
else if (s == "cjkangle")
|
||||||
qs = QuoteStyle::CJKAngleQuotes;
|
qs = QuoteStyle::CJKAngle;
|
||||||
else if (s == "dynamic")
|
else if (s == "dynamic")
|
||||||
qs = QuoteStyle::DynamicQuotes;
|
qs = QuoteStyle::Dynamic;
|
||||||
|
|
||||||
return qs;
|
return qs;
|
||||||
}
|
}
|
||||||
@ -718,23 +718,23 @@ docstring InsetQuotes::displayString() const
|
|||||||
{
|
{
|
||||||
// In PassThru, we use straight quotes
|
// In PassThru, we use straight quotes
|
||||||
if (pass_thru_)
|
if (pass_thru_)
|
||||||
return (level_ == QuoteLevel::PrimaryQuotes) ?
|
return (level_ == QuoteLevel::Primary) ?
|
||||||
from_ascii("\"") : from_ascii("'");
|
from_ascii("\"") : from_ascii("'");
|
||||||
|
|
||||||
QuoteStyle style =
|
QuoteStyle style =
|
||||||
(style_ == QuoteStyle::DynamicQuotes) ? global_style_ : style_;
|
(style_ == QuoteStyle::Dynamic) ? global_style_ : style_;
|
||||||
|
|
||||||
docstring retdisp = docstring(1, quoteparams.getQuoteChar(style, level_, side_, rtl_));
|
docstring retdisp = docstring(1, quoteparams.getQuoteChar(style, level_, side_, rtl_));
|
||||||
|
|
||||||
// in French, thin spaces are added inside double guillemets
|
// in French, thin spaces are added inside double guillemets
|
||||||
if (prefixIs(context_lang_, "fr")
|
if (prefixIs(context_lang_, "fr")
|
||||||
&& level_ == QuoteLevel::PrimaryQuotes
|
&& level_ == QuoteLevel::Primary
|
||||||
&& (style == QuoteStyle::SwissQuotes
|
&& (style == QuoteStyle::Swiss
|
||||||
|| style == QuoteStyle::FrenchQuotes
|
|| style == QuoteStyle::French
|
||||||
|| style == QuoteStyle::FrenchINQuotes)) {
|
|| style == QuoteStyle::FrenchIN)) {
|
||||||
// THIN SPACE (U+2009)
|
// THIN SPACE (U+2009)
|
||||||
char_type const thin_space = 0x2009;
|
char_type const thin_space = 0x2009;
|
||||||
if (side_ == QuoteSide::OpeningQuote)
|
if (side_ == QuoteSide::Opening)
|
||||||
retdisp += thin_space;
|
retdisp += thin_space;
|
||||||
else
|
else
|
||||||
retdisp = thin_space + retdisp;
|
retdisp = thin_space + retdisp;
|
||||||
@ -757,7 +757,7 @@ void InsetQuotes::metrics(MetricsInfo & mi, Dimension & dim) const
|
|||||||
void InsetQuotes::draw(PainterInfo & pi, int x, int y) const
|
void InsetQuotes::draw(PainterInfo & pi, int x, int y) const
|
||||||
{
|
{
|
||||||
FontInfo font = pi.base.font;
|
FontInfo font = pi.base.font;
|
||||||
if (style_ == QuoteStyle::DynamicQuotes)
|
if (style_ == QuoteStyle::Dynamic)
|
||||||
font.setPaintColor(Color_special);
|
font.setPaintColor(Color_special);
|
||||||
else
|
else
|
||||||
font.setPaintColor(pi.textColor(font.realColor()));
|
font.setPaintColor(pi.textColor(font.realColor()));
|
||||||
@ -839,17 +839,17 @@ bool InsetQuotes::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
|
void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
|
||||||
{
|
{
|
||||||
QuoteStyle style =
|
QuoteStyle style =
|
||||||
(style_ == QuoteStyle::DynamicQuotes) ? global_style_ : style_;
|
(style_ == QuoteStyle::Dynamic) ? global_style_ : style_;
|
||||||
char_type quotechar = quoteparams.getQuoteChar(style, level_, side_, rtl_);
|
char_type quotechar = quoteparams.getQuoteChar(style, level_, side_, rtl_);
|
||||||
docstring qstr;
|
docstring qstr;
|
||||||
|
|
||||||
// In pass-thru context, we output plain quotes
|
// In pass-thru context, we output plain quotes
|
||||||
if (runparams.pass_thru)
|
if (runparams.pass_thru)
|
||||||
qstr = (level_ == QuoteLevel::PrimaryQuotes) ? from_ascii("\"") : from_ascii("'");
|
qstr = (level_ == QuoteLevel::Primary) ? from_ascii("\"") : from_ascii("'");
|
||||||
else if (style == QuoteStyle::PlainQuotes && fontspec_) {
|
else if (style == QuoteStyle::Plain && fontspec_) {
|
||||||
// For XeTeX and LuaTeX,we need to disable mapping to get straight
|
// For XeTeX and LuaTeX,we need to disable mapping to get straight
|
||||||
// quotes. We define our own commands that do this
|
// quotes. We define our own commands that do this
|
||||||
qstr = (level_ == QuoteLevel::PrimaryQuotes) ?
|
qstr = (level_ == QuoteLevel::Primary) ?
|
||||||
from_ascii("\\textquotedblplain") : from_ascii("\\textquotesingleplain");
|
from_ascii("\\textquotedblplain") : from_ascii("\\textquotesingleplain");
|
||||||
}
|
}
|
||||||
else if (runparams.use_polyglossia) {
|
else if (runparams.use_polyglossia) {
|
||||||
@ -859,21 +859,21 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
|
|||||||
}
|
}
|
||||||
// The CJK marks are not yet covered by utf8 inputenc (we don't have the entry in
|
// The CJK marks are not yet covered by utf8 inputenc (we don't have the entry in
|
||||||
// unicodesymbols, since we don't want to add fake synbols there).
|
// unicodesymbols, since we don't want to add fake synbols there).
|
||||||
else if (style == QuoteStyle::CJKQuotes || style == QuoteStyle::CJKAngleQuotes) {
|
else if (style == QuoteStyle::CJK || style == QuoteStyle::CJKAngle) {
|
||||||
if (runparams.encoding && runparams.encoding->name() != "utf8"
|
if (runparams.encoding && runparams.encoding->name() != "utf8"
|
||||||
&& runparams.encoding->encodable(quotechar))
|
&& runparams.encoding->encodable(quotechar))
|
||||||
qstr = docstring(1, quotechar);
|
qstr = docstring(1, quotechar);
|
||||||
else
|
else
|
||||||
qstr = quoteparams.getLaTeXQuote(quotechar, "int");
|
qstr = quoteparams.getLaTeXQuote(quotechar, "int");
|
||||||
}
|
}
|
||||||
else if ((style == QuoteStyle::SwissQuotes
|
else if ((style == QuoteStyle::Swiss
|
||||||
|| style == QuoteStyle::FrenchQuotes
|
|| style == QuoteStyle::French
|
||||||
|| style == QuoteStyle::FrenchINQuotes)
|
|| style == QuoteStyle::FrenchIN)
|
||||||
&& level_ == QuoteLevel::PrimaryQuotes
|
&& level_ == QuoteLevel::Primary
|
||||||
&& prefixIs(runparams.local_font->language()->code(), "fr")) {
|
&& prefixIs(runparams.local_font->language()->code(), "fr")) {
|
||||||
// Specific guillemets of French babel
|
// Specific guillemets of French babel
|
||||||
// including correct French spacing
|
// including correct French spacing
|
||||||
if (side_ == QuoteSide::OpeningQuote)
|
if (side_ == QuoteSide::Opening)
|
||||||
qstr = from_ascii("\\og");
|
qstr = from_ascii("\\og");
|
||||||
else
|
else
|
||||||
qstr = from_ascii("\\fg");
|
qstr = from_ascii("\\fg");
|
||||||
@ -912,8 +912,8 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
|
|||||||
// LuaTeX does not respect {} as ligature breaker by design,
|
// LuaTeX does not respect {} as ligature breaker by design,
|
||||||
// see https://tex.stackexchange.com/q/349725/19291
|
// see https://tex.stackexchange.com/q/349725/19291
|
||||||
docstring const nolig =
|
docstring const nolig =
|
||||||
(runparams.flavor == FLAVOR::LUATEX
|
(runparams.flavor == Flavor::LuaTeX
|
||||||
|| runparams.flavor == FLAVOR::DVILUATEX) ?
|
|| runparams.flavor == Flavor::DviLuaTeX) ?
|
||||||
from_ascii("\\/") : from_ascii("{}");
|
from_ascii("\\/") : from_ascii("{}");
|
||||||
// !` ?` => !{}` ?{}`
|
// !` ?` => !{}` ?{}`
|
||||||
if (prefixIs(qstr, from_ascii("`"))
|
if (prefixIs(qstr, from_ascii("`"))
|
||||||
@ -945,19 +945,19 @@ int InsetQuotes::plaintext(odocstringstream & os,
|
|||||||
|
|
||||||
docstring InsetQuotes::getQuoteEntity(bool isHTML) const {
|
docstring InsetQuotes::getQuoteEntity(bool isHTML) const {
|
||||||
QuoteStyle style =
|
QuoteStyle style =
|
||||||
(style_ == QuoteStyle::DynamicQuotes) ? global_style_ : style_;
|
(style_ == QuoteStyle::Dynamic) ? global_style_ : style_;
|
||||||
docstring res = isHTML ? quoteparams.getHTMLQuote(quoteparams.getQuoteChar(style, level_, side_)) :
|
docstring res = isHTML ? quoteparams.getHTMLQuote(quoteparams.getQuoteChar(style, level_, side_)) :
|
||||||
quoteparams.getXMLQuote(quoteparams.getQuoteChar(style, level_, side_));
|
quoteparams.getXMLQuote(quoteparams.getQuoteChar(style, level_, side_));
|
||||||
|
|
||||||
// in French, thin spaces are added inside double guillemets
|
// in French, thin spaces are added inside double guillemets
|
||||||
if (prefixIs(context_lang_, "fr")
|
if (prefixIs(context_lang_, "fr")
|
||||||
&& level_ == QuoteLevel::PrimaryQuotes
|
&& level_ == QuoteLevel::Primary
|
||||||
&& (style == QuoteStyle::FrenchQuotes
|
&& (style == QuoteStyle::French
|
||||||
|| style == QuoteStyle::FrenchINQuotes
|
|| style == QuoteStyle::FrenchIN
|
||||||
|| style == QuoteStyle::SwissQuotes)) {
|
|| style == QuoteStyle::Swiss)) {
|
||||||
// THIN SPACE (U+2009)
|
// THIN SPACE (U+2009)
|
||||||
docstring const thin_space = from_ascii(" ");
|
docstring const thin_space = from_ascii(" ");
|
||||||
if (side_ == QuoteSide::OpeningQuote) // Open quote: space after
|
if (side_ == QuoteSide::Opening) // Open quote: space after
|
||||||
res += thin_space;
|
res += thin_space;
|
||||||
else // Close quote: space before
|
else // Close quote: space before
|
||||||
res = thin_space + res;
|
res = thin_space + res;
|
||||||
@ -1008,7 +1008,7 @@ void InsetQuotes::updateBuffer(ParIterator const & it, UpdateType /* utype*/, bo
|
|||||||
void InsetQuotes::validate(LaTeXFeatures & features) const
|
void InsetQuotes::validate(LaTeXFeatures & features) const
|
||||||
{
|
{
|
||||||
QuoteStyle style =
|
QuoteStyle style =
|
||||||
(style_ == QuoteStyle::DynamicQuotes) ? global_style_ : style_;
|
(style_ == QuoteStyle::Dynamic) ? global_style_ : style_;
|
||||||
char_type type = quoteparams.getQuoteChar(style, level_, side_);
|
char_type type = quoteparams.getQuoteChar(style, level_, side_);
|
||||||
|
|
||||||
// Handle characters that are not natively supported by
|
// Handle characters that are not natively supported by
|
||||||
|
@ -23,51 +23,51 @@ namespace lyx {
|
|||||||
///
|
///
|
||||||
enum class QuoteStyle : int {
|
enum class QuoteStyle : int {
|
||||||
///
|
///
|
||||||
EnglishQuotes,
|
English,
|
||||||
///
|
///
|
||||||
SwedishQuotes,
|
Swedish,
|
||||||
///
|
///
|
||||||
GermanQuotes,
|
German,
|
||||||
///
|
///
|
||||||
PolishQuotes,
|
Polish,
|
||||||
///
|
///
|
||||||
SwissQuotes,
|
Swiss,
|
||||||
///
|
///
|
||||||
DanishQuotes,
|
Danish,
|
||||||
///
|
///
|
||||||
PlainQuotes,
|
Plain,
|
||||||
///
|
///
|
||||||
BritishQuotes,
|
British,
|
||||||
///
|
///
|
||||||
SwedishGQuotes,
|
SwedishG,
|
||||||
///
|
///
|
||||||
FrenchQuotes,
|
French,
|
||||||
///
|
///
|
||||||
FrenchINQuotes,
|
FrenchIN,
|
||||||
///
|
///
|
||||||
RussianQuotes,
|
Russian,
|
||||||
///
|
///
|
||||||
CJKQuotes,
|
CJK,
|
||||||
///
|
///
|
||||||
CJKAngleQuotes,
|
CJKAngle,
|
||||||
///
|
///
|
||||||
DynamicQuotes
|
Dynamic
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
enum class QuoteSide : int {
|
enum class QuoteSide : int {
|
||||||
///
|
///
|
||||||
OpeningQuote,
|
Opening,
|
||||||
///
|
///
|
||||||
ClosingQuote
|
Closing
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
enum class QuoteLevel : int {
|
enum class QuoteLevel : int {
|
||||||
///
|
///
|
||||||
SecondaryQuotes,
|
Secondary,
|
||||||
///
|
///
|
||||||
PrimaryQuotes
|
Primary
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -100,15 +100,15 @@ public:
|
|||||||
/// Returns the quote style from the shortcut string
|
/// Returns the quote style from the shortcut string
|
||||||
QuoteStyle getQuoteStyle(std::string const & s,
|
QuoteStyle getQuoteStyle(std::string const & s,
|
||||||
bool const allow_wildcards = false,
|
bool const allow_wildcards = false,
|
||||||
QuoteStyle fallback = QuoteStyle::EnglishQuotes) const;
|
QuoteStyle fallback = QuoteStyle::English) const;
|
||||||
/// Returns the quote sind from the shortcut string
|
/// Returns the quote sind from the shortcut string
|
||||||
QuoteSide getQuoteSide(std::string const & s,
|
QuoteSide getQuoteSide(std::string const & s,
|
||||||
bool const allow_wildcards = false,
|
bool const allow_wildcards = false,
|
||||||
QuoteSide fallback = QuoteSide::OpeningQuote) const;
|
QuoteSide fallback = QuoteSide::Opening) const;
|
||||||
/// Returns the quote level from the shortcut string
|
/// Returns the quote level from the shortcut string
|
||||||
QuoteLevel getQuoteLevel(std::string const & s,
|
QuoteLevel getQuoteLevel(std::string const & s,
|
||||||
bool const allow_wildcards = false,
|
bool const allow_wildcards = false,
|
||||||
QuoteLevel fallback = QuoteLevel::PrimaryQuotes) const;
|
QuoteLevel fallback = QuoteLevel::Primary) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -191,13 +191,13 @@ private:
|
|||||||
QuoteStyle getStyle(std::string const &);
|
QuoteStyle getStyle(std::string const &);
|
||||||
|
|
||||||
///
|
///
|
||||||
QuoteStyle style_ = QuoteStyle::EnglishQuotes;
|
QuoteStyle style_ = QuoteStyle::English;
|
||||||
///
|
///
|
||||||
QuoteSide side_ = QuoteSide::OpeningQuote;
|
QuoteSide side_ = QuoteSide::Opening;
|
||||||
///
|
///
|
||||||
QuoteLevel level_ = QuoteLevel::PrimaryQuotes;
|
QuoteLevel level_ = QuoteLevel::Primary;
|
||||||
///
|
///
|
||||||
QuoteStyle global_style_ = QuoteStyle::EnglishQuotes;
|
QuoteStyle global_style_ = QuoteStyle::English;
|
||||||
/// Current font encoding
|
/// Current font encoding
|
||||||
std::string fontenc_;
|
std::string fontenc_;
|
||||||
/// Code of the contextual language
|
/// Code of the contextual language
|
||||||
|
@ -905,7 +905,7 @@ static docstring buffer_to_latex(Buffer & buffer)
|
|||||||
odocstringstream ods;
|
odocstringstream ods;
|
||||||
otexstream os(ods);
|
otexstream os(ods);
|
||||||
runparams.nice = true;
|
runparams.nice = true;
|
||||||
runparams.flavor = FLAVOR::XETEX;
|
runparams.flavor = Flavor::XeTeX;
|
||||||
runparams.linelen = 10000; //lyxrc.plaintext_linelen;
|
runparams.linelen = 10000; //lyxrc.plaintext_linelen;
|
||||||
// No side effect of file copying and image conversion
|
// No side effect of file copying and image conversion
|
||||||
runparams.dryrun = true;
|
runparams.dryrun = true;
|
||||||
@ -928,7 +928,7 @@ static docstring stringifySearchBuffer(Buffer & buffer, FindAndReplaceOptions co
|
|||||||
// OutputParams runparams(&buffer.params().encoding());
|
// OutputParams runparams(&buffer.params().encoding());
|
||||||
OutputParams runparams(encodings.fromLyXName("utf8"));
|
OutputParams runparams(encodings.fromLyXName("utf8"));
|
||||||
runparams.nice = true;
|
runparams.nice = true;
|
||||||
runparams.flavor = FLAVOR::XETEX;
|
runparams.flavor = Flavor::XeTeX;
|
||||||
runparams.linelen = 10000; //lyxrc.plaintext_linelen;
|
runparams.linelen = 10000; //lyxrc.plaintext_linelen;
|
||||||
runparams.dryrun = true;
|
runparams.dryrun = true;
|
||||||
runparams.for_search = true;
|
runparams.for_search = true;
|
||||||
@ -3119,7 +3119,7 @@ docstring stringifyFromCursor(DocIterator const & cur, int len)
|
|||||||
// OutputParams runparams(&cur.buffer()->params().encoding());
|
// OutputParams runparams(&cur.buffer()->params().encoding());
|
||||||
OutputParams runparams(encodings.fromLyXName("utf8"));
|
OutputParams runparams(encodings.fromLyXName("utf8"));
|
||||||
runparams.nice = true;
|
runparams.nice = true;
|
||||||
runparams.flavor = FLAVOR::XETEX;
|
runparams.flavor = Flavor::XeTeX;
|
||||||
runparams.linelen = 10000; //lyxrc.plaintext_linelen;
|
runparams.linelen = 10000; //lyxrc.plaintext_linelen;
|
||||||
// No side effect of file copying and image conversion
|
// No side effect of file copying and image conversion
|
||||||
runparams.dryrun = true;
|
runparams.dryrun = true;
|
||||||
@ -3165,7 +3165,7 @@ docstring latexifyFromCursor(DocIterator const & cur, int len)
|
|||||||
//OutputParams runparams(&buf.params().encoding());
|
//OutputParams runparams(&buf.params().encoding());
|
||||||
OutputParams runparams(encodings.fromLyXName("utf8"));
|
OutputParams runparams(encodings.fromLyXName("utf8"));
|
||||||
runparams.nice = false;
|
runparams.nice = false;
|
||||||
runparams.flavor = FLAVOR::XETEX;
|
runparams.flavor = Flavor::XeTeX;
|
||||||
runparams.linelen = 8000; //lyxrc.plaintext_linelen;
|
runparams.linelen = 8000; //lyxrc.plaintext_linelen;
|
||||||
// No side effect of file copying and image conversion
|
// No side effect of file copying and image conversion
|
||||||
runparams.dryrun = true;
|
runparams.dryrun = true;
|
||||||
@ -3641,7 +3641,7 @@ static int findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, Ma
|
|||||||
// OutputParams runparams(&repl_buffer.params().encoding());
|
// OutputParams runparams(&repl_buffer.params().encoding());
|
||||||
OutputParams runparams(encodings.fromLyXName("utf8"));
|
OutputParams runparams(encodings.fromLyXName("utf8"));
|
||||||
runparams.nice = false;
|
runparams.nice = false;
|
||||||
runparams.flavor = FLAVOR::XETEX;
|
runparams.flavor = Flavor::XeTeX;
|
||||||
runparams.linelen = 8000; //lyxrc.plaintext_linelen;
|
runparams.linelen = 8000; //lyxrc.plaintext_linelen;
|
||||||
runparams.dryrun = true;
|
runparams.dryrun = true;
|
||||||
TeXOnePar(repl_buffer, repl_buffer.text(), 0, os, runparams);
|
TeXOnePar(repl_buffer, repl_buffer.text(), 0, os, runparams);
|
||||||
|
Loading…
Reference in New Issue
Block a user