};
-static char const * const string_quotes_language[] = {
- "english", "swedish", "german", "polish", "french", "danish", ""
+static char const * const string_quotes_style[] = {
+ "english", "swedish", "german", "polish", "swiss", "danish", "plain",
+ "british", "swedishg", "french", "frenchin", "russian", "cjk", "cjkangle", ""
};
}
-// Quotes language
-typedef Translator<string, InsetQuotes::QuoteLanguage> QuotesLangTranslator;
+// Quotes style
+typedef Translator<string, InsetQuotesParams::QuoteStyle> QuotesStyleTranslator;
-QuotesLangTranslator const init_quoteslangtranslator()
+QuotesStyleTranslator const init_quotesstyletranslator()
{
- QuotesLangTranslator translator
- (string_quotes_language[0], InsetQuotes::EnglishQuotes);
- translator.addPair(string_quotes_language[1], InsetQuotes::SwedishQuotes);
- translator.addPair(string_quotes_language[2], InsetQuotes::GermanQuotes);
- translator.addPair(string_quotes_language[3], InsetQuotes::PolishQuotes);
- translator.addPair(string_quotes_language[4], InsetQuotes::FrenchQuotes);
- translator.addPair(string_quotes_language[5], InsetQuotes::DanishQuotes);
+ 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);
return translator;
}
-QuotesLangTranslator const & quoteslangtranslator()
+QuotesStyleTranslator const & quotesstyletranslator()
{
- static QuotesLangTranslator const translator =
- init_quoteslangtranslator();
+ static QuotesStyleTranslator const translator =
+ init_quotesstyletranslator();
return translator;
}
VSpace defskip;
PDFOptions pdfoptions;
LayoutFileIndex baseClass_;
- /// Caching for exportableFormats, which seems to be slow.
- std::vector<Format const *> exportableFormatList;
- std::vector<Format const *> viewableFormatList;
+ FormatList exportableFormatList;
+ FormatList viewableFormatList;
bool isViewCacheValid;
bool isExportCacheValid;
};
cite_engine_type_ = ENGINE_TYPE_DEFAULT;
makeDocumentClass();
paragraph_separation = ParagraphIndentSeparation;
- quotes_language = InsetQuotes::EnglishQuotes;
+ quotes_style = InsetQuotesParams::EnglishQuotes;
+ dynamic_quotes = false;
fontsize = "default";
/* PaperLayout */
if (pimpl_->defskip.kind() == VSpace::DEFSKIP)
// that is invalid
pimpl_->defskip = VSpace(VSpace::MEDSKIP);
- } else if (token == "\\quotes_language") {
- string quotes_lang;
- lex >> quotes_lang;
- quotes_language = quoteslangtranslator().find(quotes_lang);
+ } else if (token == "\\quotes_style") {
+ string qstyle;
+ lex >> qstyle;
+ quotes_style = quotesstyletranslator().find(qstyle);
+ } else if (token == "\\dynamic_quotes") {
+ lex >> dynamic_quotes;
} else if (token == "\\papersize") {
string ppsize;
lex >> ppsize;
os << "\n\\paragraph_indentation " << getIndentation().asLyXCommand();
else
os << "\n\\defskip " << getDefSkip().asLyXCommand();
- os << "\n\\quotes_language "
- << string_quotes_language[quotes_language]
+ os << "\n\\quotes_style "
+ << string_quotes_style[quotes_style]
+ << "\n\\dynamic_quotes " << dynamic_quotes
<< "\n\\papercolumns " << columns
<< "\n\\papersides " << sides
<< "\n\\paperpagestyle " << pagestyle << '\n';
// some languages are only available via polyglossia
if (features.hasPolyglossiaExclusiveLanguages())
- features.require("polyglossia");
+ features.require("polyglossia");
if (useNonTeXFonts && fontsMath() != "auto")
features.require("unicode-math");
os << "[" << from_ascii(language->polyglossiaOpts()) << "]";
os << "{" << from_ascii(language->polyglossia()) << "}\n";
// now setup the other languages
- std::map<std::string, std::string> const polylangs =
+ set<string> const polylangs =
features.getPolyglossiaLanguages();
- for (std::map<std::string, std::string>::const_iterator mit = polylangs.begin();
+ for (set<string>::const_iterator mit = polylangs.begin();
mit != polylangs.end() ; ++mit) {
+ // We do not output the options here; they are output in
+ // the language switch commands. This is safer if multiple
+ // varieties are used.
+ if (*mit == language->polyglossia())
+ continue;
os << "\\setotherlanguage";
- if (!mit->second.empty())
- os << "[" << from_ascii(mit->second) << "]";
- os << "{" << from_ascii(mit->first) << "}\n";
+ os << "{" << from_ascii(*mit) << "}\n";
}
}
}
-bool BufferParams::isExportable(string const & format) const
+bool BufferParams::isExportable(string const & format, bool need_viewable) const
{
- vector<string> backs = backends();
- for (vector<string>::const_iterator it = backs.begin();
- it != backs.end(); ++it)
- if (theConverters().isReachable(*it, format))
+ FormatList const & formats = exportableFormats(need_viewable);
+ FormatList::const_iterator fit = formats.begin();
+ FormatList::const_iterator end = formats.end();
+ for (; fit != end ; ++fit) {
+ if ((*fit)->name() == format)
return true;
+ }
return false;
}
-vector<Format const *> const & BufferParams::exportableFormats(bool only_viewable) const
+FormatList const & BufferParams::exportableFormats(bool only_viewable) const
{
- vector<Format const *> & cached = only_viewable ?
+ FormatList & cached = only_viewable ?
pimpl_->viewableFormatList : pimpl_->exportableFormatList;
bool & valid = only_viewable ?
pimpl_->isViewCacheValid : pimpl_->isExportCacheValid;
excludes.insert("latex");
excludes.insert("pdflatex");
}
- vector<Format const *> result =
+ FormatList result =
theConverters().getReachable(backs[0], only_viewable, true, excludes);
for (vector<string>::const_iterator it = backs.begin() + 1;
it != backs.end(); ++it) {
- vector<Format const *> r =
- theConverters().getReachable(*it, only_viewable, false, excludes);
+ FormatList r = theConverters().getReachable(*it, only_viewable,
+ false, excludes);
result.insert(result.end(), r.begin(), r.end());
}
sort(result.begin(), result.end(), Format::formatSorter);
}
-bool BufferParams::isExportableFormat(string const & format) const
-{
- typedef vector<Format const *> Formats;
- Formats const & formats = exportableFormats(true);
- Formats::const_iterator fit = formats.begin();
- Formats::const_iterator end = formats.end();
- for (; fit != end ; ++fit) {
- if ((*fit)->name() == format)
- return true;
- }
- return false;
-}
-
-
vector<string> BufferParams::backends() const
{
vector<string> v;
return default_output_format;
if (isDocBook()
|| encoding().package() == Encoding::japanese) {
- vector<Format const *> const & formats = exportableFormats(true);
+ FormatList const & formats = exportableFormats(true);
if (formats.empty())
return string();
// return the first we find
}
-InsetQuotes::QuoteLanguage BufferParams::getQuoteStyle(string const & qs) const
+InsetQuotesParams::QuoteStyle BufferParams::getQuoteStyle(string const & qs) const
{
- return quoteslangtranslator().find(qs);
+ return quotesstyletranslator().find(qs);
}