mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-10 18:58:10 +00:00
More requires --> required, for C++2a.
This commit is contained in:
parent
21b4ecca7f
commit
62af7ee772
@ -1606,8 +1606,8 @@ void BufferParams::validate(LaTeXFeatures & features) const
|
|||||||
if (use_microtype)
|
if (use_microtype)
|
||||||
features.require("microtype");
|
features.require("microtype");
|
||||||
|
|
||||||
if (!language->requires().empty())
|
if (!language->required().empty())
|
||||||
features.require(language->requires());
|
features.require(language->required());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ bool LyXCiteEngine::isDefaultBiblio(string const & bf) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LyXCiteEngine::requires(const string p) const
|
bool LyXCiteEngine::required(const string p) const
|
||||||
{
|
{
|
||||||
return find(package_list_.begin(), package_list_.end(), p) != package_list_.end();
|
return find(package_list_.begin(), package_list_.end(), p) != package_list_.end();
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ public:
|
|||||||
std::vector<std::string> const & getPackageList() const
|
std::vector<std::string> const & getPackageList() const
|
||||||
{ return package_list_; }
|
{ return package_list_; }
|
||||||
///
|
///
|
||||||
bool requires(std::string const p) const;
|
bool required(std::string const p) const;
|
||||||
private:
|
private:
|
||||||
/// what appears in the ui
|
/// what appears in the ui
|
||||||
std::string name_;
|
std::string name_;
|
||||||
|
@ -35,7 +35,7 @@ Floating::Floating(string const & type, string const & placement,
|
|||||||
bool allowswide, bool allowssideways)
|
bool allowswide, bool allowssideways)
|
||||||
: floattype_(type), placement_(placement), ext_(ext), within_(within),
|
: floattype_(type), placement_(placement), ext_(ext), within_(within),
|
||||||
style_(style), name_(name), listname_(listName), listcommand_(listCmd),
|
style_(style), name_(name), listname_(listName), listcommand_(listCmd),
|
||||||
refprefix_(refPrefix), allowedplacement_(allowedplacement), requires_(requires),
|
refprefix_(refPrefix), allowedplacement_(allowedplacement), required_(requires),
|
||||||
usesfloatpkg_(usesfloat), ispredefined_(ispredefined),
|
usesfloatpkg_(usesfloat), ispredefined_(ispredefined),
|
||||||
allowswide_(allowswide), allowssideways_(allowssideways),
|
allowswide_(allowswide), allowssideways_(allowssideways),
|
||||||
html_tag_(htmlTag), html_attrib_(htmlAttrib), html_style_(htmlStyle)
|
html_tag_(htmlTag), html_attrib_(htmlAttrib), html_style_(htmlStyle)
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
std::string const & listName, std::string const & listCmd,
|
std::string const & listName, std::string const & listCmd,
|
||||||
std::string const & refPrefix, std::string const & allowedplacement,
|
std::string const & refPrefix, std::string const & allowedplacement,
|
||||||
std::string const & htmlType, std::string const & htmlClass,
|
std::string const & htmlType, std::string const & htmlClass,
|
||||||
docstring const & htmlStyle, std::string const & requires,
|
docstring const & htmlStyle, std::string const & required,
|
||||||
bool usesfloat, bool isprefined,
|
bool usesfloat, bool isprefined,
|
||||||
bool allowswide, bool allowssideways);
|
bool allowswide, bool allowssideways);
|
||||||
///
|
///
|
||||||
@ -66,7 +66,7 @@ public:
|
|||||||
///
|
///
|
||||||
bool usesFloatPkg() const { return usesfloatpkg_; }
|
bool usesFloatPkg() const { return usesfloatpkg_; }
|
||||||
/// allowed placement options
|
/// allowed placement options
|
||||||
std::string const & requires() const { return requires_; }
|
std::string const & required() const { return required_; }
|
||||||
///
|
///
|
||||||
bool isPredefined() const { return ispredefined_; }
|
bool isPredefined() const { return ispredefined_; }
|
||||||
///
|
///
|
||||||
@ -103,7 +103,7 @@ private:
|
|||||||
///
|
///
|
||||||
std::string allowedplacement_;
|
std::string allowedplacement_;
|
||||||
///
|
///
|
||||||
std::string requires_;
|
std::string required_;
|
||||||
///
|
///
|
||||||
bool usesfloatpkg_;
|
bool usesfloatpkg_;
|
||||||
///
|
///
|
||||||
|
@ -878,8 +878,8 @@ void LaTeXFeatures::useFloat(string const & name, bool subfloat)
|
|||||||
if (!fl.floattype().empty()) {
|
if (!fl.floattype().empty()) {
|
||||||
if (fl.usesFloatPkg())
|
if (fl.usesFloatPkg())
|
||||||
require("float");
|
require("float");
|
||||||
if (!fl.requires().empty()) {
|
if (!fl.required().empty()) {
|
||||||
vector<string> reqs = getVectorFromString(fl.requires());
|
vector<string> reqs = getVectorFromString(fl.required());
|
||||||
for (auto const req : reqs)
|
for (auto const req : reqs)
|
||||||
require(req);
|
require(req);
|
||||||
}
|
}
|
||||||
@ -891,8 +891,8 @@ void LaTeXFeatures::useLanguage(Language const * lang)
|
|||||||
{
|
{
|
||||||
if (!lang->babel().empty() || !lang->polyglossia().empty())
|
if (!lang->babel().empty() || !lang->polyglossia().empty())
|
||||||
UsedLanguages_.insert(lang);
|
UsedLanguages_.insert(lang);
|
||||||
if (!lang->requires().empty())
|
if (!lang->required().empty())
|
||||||
require(lang->requires());
|
require(lang->required());
|
||||||
// currently only supported for Babel
|
// currently only supported for Babel
|
||||||
if (!lang->provides().empty() && useBabel())
|
if (!lang->provides().empty() && useBabel())
|
||||||
provide(lang->provides());
|
provide(lang->provides());
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
/// Does this provide additional options?
|
/// Does this provide additional options?
|
||||||
bool providesMoreOptions(bool ot1, bool complete, bool nomath);
|
bool providesMoreOptions(bool ot1, bool complete, bool nomath);
|
||||||
/// Alternative requirement to test for
|
/// Alternative requirement to test for
|
||||||
docstring const & requires() { return requires_; }
|
docstring const & required() { return requires_; }
|
||||||
/// Does this font provide a given \p feature
|
/// Does this font provide a given \p feature
|
||||||
bool provides(std::string const & name, bool ot1,
|
bool provides(std::string const & name, bool ot1,
|
||||||
bool complete, bool nomath);
|
bool complete, bool nomath);
|
||||||
|
@ -45,13 +45,13 @@ Language const * reset_language = 0;
|
|||||||
|
|
||||||
bool Language::isPolyglossiaExclusive() const
|
bool Language::isPolyglossiaExclusive() const
|
||||||
{
|
{
|
||||||
return babel().empty() && !polyglossia().empty() && requires().empty();
|
return babel().empty() && !polyglossia().empty() && required().empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Language::isBabelExclusive() const
|
bool Language::isBabelExclusive() const
|
||||||
{
|
{
|
||||||
return !babel().empty() && polyglossia().empty() && requires().empty();
|
return !babel().empty() && polyglossia().empty() && required().empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
/// active characters
|
/// active characters
|
||||||
std::string const activeChars() const { return active_chars_; }
|
std::string const activeChars() const { return active_chars_; }
|
||||||
/// requirement (package, function)
|
/// requirement (package, function)
|
||||||
std::string const requires() const { return requires_; }
|
std::string const required() const { return requires_; }
|
||||||
/// provides feature
|
/// provides feature
|
||||||
std::string const provides() const { return provides_; }
|
std::string const provides() const { return provides_; }
|
||||||
/// translatable GUI name
|
/// translatable GUI name
|
||||||
|
@ -2274,7 +2274,7 @@ void GuiDocument::languageChanged(int i)
|
|||||||
Language const * lang = lyx::languages.getLanguage(
|
Language const * lang = lyx::languages.getLanguage(
|
||||||
fromqstr(langModule->languageCO->itemData(i).toString()));
|
fromqstr(langModule->languageCO->itemData(i).toString()));
|
||||||
if (lang->babel().empty() && !lang->polyglossia().empty()
|
if (lang->babel().empty() && !lang->polyglossia().empty()
|
||||||
&& lang->requires() != "CJK" && lang->requires() != "japanese") {
|
&& lang->required() != "CJK" && lang->required() != "japanese") {
|
||||||
// If we force to switch fontspec on, store
|
// If we force to switch fontspec on, store
|
||||||
// current state (#8717)
|
// current state (#8717)
|
||||||
if (fontModule->osFontsCB->isEnabled())
|
if (fontModule->osFontsCB->isEnabled())
|
||||||
@ -2971,8 +2971,8 @@ void GuiDocument::updateEngineDependends()
|
|||||||
biblioModule->citeEngineCO->currentIndex()).toString();
|
biblioModule->citeEngineCO->currentIndex()).toString();
|
||||||
LyXCiteEngine const * ce = theCiteEnginesList[fromqstr(engine)];
|
LyXCiteEngine const * ce = theCiteEnginesList[fromqstr(engine)];
|
||||||
|
|
||||||
bool const citepack = ce->requires("biblatex.sty") || ce->requires("jurabib.sty")
|
bool const citepack = ce->required("biblatex.sty") || ce->required("jurabib.sty")
|
||||||
|| ce->requires("natbib.sty");
|
|| ce->required("natbib.sty");
|
||||||
biblioModule->citePackageOptionsLE->setEnabled(citepack);
|
biblioModule->citePackageOptionsLE->setEnabled(citepack);
|
||||||
biblioModule->citePackageOptionsL->setEnabled(citepack);
|
biblioModule->citePackageOptionsL->setEnabled(citepack);
|
||||||
}
|
}
|
||||||
@ -4196,7 +4196,7 @@ void GuiDocument::paramsToDialog()
|
|||||||
langModule->languageCO->currentIndex()).toString()));
|
langModule->languageCO->currentIndex()).toString()));
|
||||||
bool const need_fontspec =
|
bool const need_fontspec =
|
||||||
lang->babel().empty() && !lang->polyglossia().empty()
|
lang->babel().empty() && !lang->polyglossia().empty()
|
||||||
&& lang->requires() != "CJK" && lang->requires() != "japanese";
|
&& lang->required() != "CJK" && lang->required() != "japanese";
|
||||||
bool const os_fonts_available =
|
bool const os_fonts_available =
|
||||||
bp_.baseClass()->outputType() == lyx::LATEX
|
bp_.baseClass()->outputType() == lyx::LATEX
|
||||||
&& LaTeXFeatures::isAvailable("fontspec");
|
&& LaTeXFeatures::isAvailable("fontspec");
|
||||||
|
@ -283,8 +283,8 @@ void InsetMathDecoration::validate(LaTeXFeatures & features) const
|
|||||||
"span.symbol{height: 0.5ex;}");
|
"span.symbol{height: 0.5ex;}");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!key_->requires.empty())
|
if (!key_->required.empty())
|
||||||
features.require(key_->requires);
|
features.require(key_->required);
|
||||||
}
|
}
|
||||||
InsetMathNest::validate(features);
|
InsetMathNest::validate(features);
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,8 @@ docstring InsetMathDots::name() const
|
|||||||
|
|
||||||
void InsetMathDots::validate(LaTeXFeatures & features) const
|
void InsetMathDots::validate(LaTeXFeatures & features) const
|
||||||
{
|
{
|
||||||
if (!key_->requires.empty())
|
if (!key_->required.empty())
|
||||||
features.require(key_->requires);
|
features.require(key_->required);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -644,7 +644,7 @@ void InsetMathMacro::updateRepresentation(Cursor * cur, MacroContext const & mc,
|
|||||||
d->nesting_ = nesting;
|
d->nesting_ = nesting;
|
||||||
|
|
||||||
// update requires
|
// update requires
|
||||||
d->requires_ = d->macro_->requires();
|
d->requires_ = d->macro_->required();
|
||||||
|
|
||||||
if (!d->needsUpdate_
|
if (!d->needsUpdate_
|
||||||
// non-normal mode? We are done!
|
// non-normal mode? We are done!
|
||||||
@ -911,8 +911,8 @@ void InsetMathMacro::validate(LaTeXFeatures & features) const
|
|||||||
else if (!d->macro_) {
|
else if (!d->macro_) {
|
||||||
// Update requires for known global macros.
|
// Update requires for known global macros.
|
||||||
MacroData const * data = MacroTable::globalMacros().get(name());
|
MacroData const * data = MacroTable::globalMacros().get(name());
|
||||||
if (data && !data->requires().empty())
|
if (data && !data->required().empty())
|
||||||
features.require(data->requires());
|
features.require(data->required());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name() == "binom")
|
if (name() == "binom")
|
||||||
|
@ -247,8 +247,8 @@ void InsetMathSymbol::validate(LaTeXFeatures & features) const
|
|||||||
"sub.limit{font-size: 75%;}\n"
|
"sub.limit{font-size: 75%;}\n"
|
||||||
"sup.limit{font-size: 75%;}");
|
"sup.limit{font-size: 75%;}");
|
||||||
} else {
|
} else {
|
||||||
if (!sym_->requires.empty())
|
if (!sym_->required.empty())
|
||||||
features.require(sym_->requires);
|
features.require(sym_->required);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,10 +110,10 @@ vector<docstring> const & MacroData::defaults() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string const MacroData::requires() const
|
string const MacroData::required() const
|
||||||
{
|
{
|
||||||
if (sym_)
|
if (sym_)
|
||||||
return sym_->requires;
|
return sym_->required;
|
||||||
return string();
|
return string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public:
|
|||||||
///
|
///
|
||||||
std::vector<docstring> const & defaults() const;
|
std::vector<docstring> const & defaults() const;
|
||||||
///
|
///
|
||||||
std::string const requires() const;
|
std::string const required() const;
|
||||||
///
|
///
|
||||||
bool hidden() const;
|
bool hidden() const;
|
||||||
///
|
///
|
||||||
|
@ -217,7 +217,7 @@ void initSymbols()
|
|||||||
requires = "";
|
requires = "";
|
||||||
tmp.hidden = hidden = true;
|
tmp.hidden = hidden = true;
|
||||||
} else
|
} else
|
||||||
tmp.requires = requires;
|
tmp.required = requires;
|
||||||
theMathWordList[it->first] = tmp;
|
theMathWordList[it->first] = tmp;
|
||||||
wit = theMathWordList.find(it->first);
|
wit = theMathWordList.find(it->first);
|
||||||
it->second.setSymbol(&(wit->second));
|
it->second.setSymbol(&(wit->second));
|
||||||
@ -249,9 +249,9 @@ void initSymbols()
|
|||||||
if ((is >> help)) {
|
if ((is >> help)) {
|
||||||
// backward compatibility
|
// backward compatibility
|
||||||
if (help == "esintoramsmath")
|
if (help == "esintoramsmath")
|
||||||
tmp.requires = "esint|amsmath";
|
tmp.required = "esint|amsmath";
|
||||||
else
|
else
|
||||||
tmp.requires = to_ascii(help);
|
tmp.required = to_ascii(help);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LYXERR(Debug::MATHED, "skipping line '" << line << "'\n"
|
LYXERR(Debug::MATHED, "skipping line '" << line << "'\n"
|
||||||
@ -265,13 +265,13 @@ void initSymbols()
|
|||||||
// create fallbacks if necessary
|
// create fallbacks if necessary
|
||||||
|
|
||||||
// store requirements as long as we can
|
// store requirements as long as we can
|
||||||
if (tmp.requires.empty()) {
|
if (tmp.required.empty()) {
|
||||||
if (tmp.inset == "msa" || tmp.inset == "msb")
|
if (tmp.inset == "msa" || tmp.inset == "msb")
|
||||||
tmp.requires = "amssymb";
|
tmp.required = "amssymb";
|
||||||
else if (tmp.inset == "wasy")
|
else if (tmp.inset == "wasy")
|
||||||
tmp.requires = "wasysym";
|
tmp.required = "wasysym";
|
||||||
else if (tmp.inset == "mathscr")
|
else if (tmp.inset == "mathscr")
|
||||||
tmp.requires = "mathrsfs";
|
tmp.required = "mathrsfs";
|
||||||
}
|
}
|
||||||
|
|
||||||
// symbol font is not available sometimes
|
// symbol font is not available sometimes
|
||||||
@ -307,9 +307,9 @@ void initSymbols()
|
|||||||
<< " used for " << to_utf8(tmp.name));
|
<< " used for " << to_utf8(tmp.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp.requires == "hiddensymbol")
|
if (tmp.required == "hiddensymbol")
|
||||||
{
|
{
|
||||||
tmp.requires = "";
|
tmp.required = "";
|
||||||
tmp.hidden = true;
|
tmp.hidden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ void initSymbols()
|
|||||||
<< " draw: " << int(tmp.draw.empty() ? 0 : tmp.draw[0])
|
<< " draw: " << int(tmp.draw.empty() ? 0 : tmp.draw[0])
|
||||||
<< " extra: " << to_utf8(tmp.extra)
|
<< " extra: " << to_utf8(tmp.extra)
|
||||||
<< " xml: " << to_utf8(tmp.xmlname)
|
<< " xml: " << to_utf8(tmp.xmlname)
|
||||||
<< " requires: " << tmp.requires
|
<< " requires: " << tmp.required
|
||||||
<< " hidden: " << tmp.hidden << '\'');
|
<< " hidden: " << tmp.hidden << '\'');
|
||||||
}
|
}
|
||||||
string tmp = "cmm";
|
string tmp = "cmm";
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
/// how is this called as XML entity in MathML?
|
/// how is this called as XML entity in MathML?
|
||||||
docstring xmlname;
|
docstring xmlname;
|
||||||
/// required LaTeXFeatures
|
/// required LaTeXFeatures
|
||||||
std::string requires;
|
std::string required;
|
||||||
/// Should this macro be hidden from autocompletion (since it requires
|
/// Should this macro be hidden from autocompletion (since it requires
|
||||||
/// user preamble code)?
|
/// user preamble code)?
|
||||||
bool hidden;
|
bool hidden;
|
||||||
|
@ -1024,7 +1024,7 @@ void validate_math_word(LaTeXFeatures & features, docstring const & word)
|
|||||||
MathWordList const & words = mathedWordList();
|
MathWordList const & words = mathedWordList();
|
||||||
MathWordList::const_iterator it = words.find(word);
|
MathWordList::const_iterator it = words.find(word);
|
||||||
if (it != words.end()) {
|
if (it != words.end()) {
|
||||||
string const req = it->second.requires;
|
string const req = it->second.required;
|
||||||
if (!req.empty())
|
if (!req.empty())
|
||||||
features.require(req);
|
features.require(req);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user