More requires --> required, for C++2a.

This commit is contained in:
Richard Kimberly Heck 2020-02-28 00:36:55 -05:00
parent 21b4ecca7f
commit 62af7ee772
19 changed files with 44 additions and 44 deletions

View File

@ -1606,8 +1606,8 @@ void BufferParams::validate(LaTeXFeatures & features) const
if (use_microtype)
features.require("microtype");
if (!language->requires().empty())
features.require(language->requires());
if (!language->required().empty())
features.require(language->required());
}

View File

@ -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();
}

View File

@ -80,7 +80,7 @@ public:
std::vector<std::string> const & getPackageList() const
{ return package_list_; }
///
bool requires(std::string const p) const;
bool required(std::string const p) const;
private:
/// what appears in the ui
std::string name_;

View File

@ -35,7 +35,7 @@ Floating::Floating(string const & type, string const & placement,
bool allowswide, bool allowssideways)
: floattype_(type), placement_(placement), ext_(ext), within_(within),
style_(style), name_(name), listname_(listName), listcommand_(listCmd),
refprefix_(refPrefix), allowedplacement_(allowedplacement), requires_(requires),
refprefix_(refPrefix), allowedplacement_(allowedplacement), required_(requires),
usesfloatpkg_(usesfloat), ispredefined_(ispredefined),
allowswide_(allowswide), allowssideways_(allowssideways),
html_tag_(htmlTag), html_attrib_(htmlAttrib), html_style_(htmlStyle)

View File

@ -37,7 +37,7 @@ public:
std::string const & listName, std::string const & listCmd,
std::string const & refPrefix, std::string const & allowedplacement,
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 allowswide, bool allowssideways);
///
@ -66,7 +66,7 @@ public:
///
bool usesFloatPkg() const { return usesfloatpkg_; }
/// allowed placement options
std::string const & requires() const { return requires_; }
std::string const & required() const { return required_; }
///
bool isPredefined() const { return ispredefined_; }
///
@ -103,7 +103,7 @@ private:
///
std::string allowedplacement_;
///
std::string requires_;
std::string required_;
///
bool usesfloatpkg_;
///

View File

@ -878,8 +878,8 @@ void LaTeXFeatures::useFloat(string const & name, bool subfloat)
if (!fl.floattype().empty()) {
if (fl.usesFloatPkg())
require("float");
if (!fl.requires().empty()) {
vector<string> reqs = getVectorFromString(fl.requires());
if (!fl.required().empty()) {
vector<string> reqs = getVectorFromString(fl.required());
for (auto const req : reqs)
require(req);
}
@ -891,8 +891,8 @@ void LaTeXFeatures::useLanguage(Language const * lang)
{
if (!lang->babel().empty() || !lang->polyglossia().empty())
UsedLanguages_.insert(lang);
if (!lang->requires().empty())
require(lang->requires());
if (!lang->required().empty())
require(lang->required());
// currently only supported for Babel
if (!lang->provides().empty() && useBabel())
provide(lang->provides());

View File

@ -59,7 +59,7 @@ public:
/// Does this provide additional options?
bool providesMoreOptions(bool ot1, bool complete, bool nomath);
/// Alternative requirement to test for
docstring const & requires() { return requires_; }
docstring const & required() { return requires_; }
/// Does this font provide a given \p feature
bool provides(std::string const & name, bool ot1,
bool complete, bool nomath);

View File

@ -45,13 +45,13 @@ Language const * reset_language = 0;
bool Language::isPolyglossiaExclusive() const
{
return babel().empty() && !polyglossia().empty() && requires().empty();
return babel().empty() && !polyglossia().empty() && required().empty();
}
bool Language::isBabelExclusive() const
{
return !babel().empty() && polyglossia().empty() && requires().empty();
return !babel().empty() && polyglossia().empty() && required().empty();
}

View File

@ -57,7 +57,7 @@ public:
/// active characters
std::string const activeChars() const { return active_chars_; }
/// requirement (package, function)
std::string const requires() const { return requires_; }
std::string const required() const { return requires_; }
/// provides feature
std::string const provides() const { return provides_; }
/// translatable GUI name

View File

@ -2274,7 +2274,7 @@ void GuiDocument::languageChanged(int i)
Language const * lang = lyx::languages.getLanguage(
fromqstr(langModule->languageCO->itemData(i).toString()));
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
// current state (#8717)
if (fontModule->osFontsCB->isEnabled())
@ -2971,8 +2971,8 @@ void GuiDocument::updateEngineDependends()
biblioModule->citeEngineCO->currentIndex()).toString();
LyXCiteEngine const * ce = theCiteEnginesList[fromqstr(engine)];
bool const citepack = ce->requires("biblatex.sty") || ce->requires("jurabib.sty")
|| ce->requires("natbib.sty");
bool const citepack = ce->required("biblatex.sty") || ce->required("jurabib.sty")
|| ce->required("natbib.sty");
biblioModule->citePackageOptionsLE->setEnabled(citepack);
biblioModule->citePackageOptionsL->setEnabled(citepack);
}
@ -4196,7 +4196,7 @@ void GuiDocument::paramsToDialog()
langModule->languageCO->currentIndex()).toString()));
bool const need_fontspec =
lang->babel().empty() && !lang->polyglossia().empty()
&& lang->requires() != "CJK" && lang->requires() != "japanese";
&& lang->required() != "CJK" && lang->required() != "japanese";
bool const os_fonts_available =
bp_.baseClass()->outputType() == lyx::LATEX
&& LaTeXFeatures::isAvailable("fontspec");

View File

@ -283,8 +283,8 @@ void InsetMathDecoration::validate(LaTeXFeatures & features) const
"span.symbol{height: 0.5ex;}");
}
} else {
if (!key_->requires.empty())
features.require(key_->requires);
if (!key_->required.empty())
features.require(key_->required);
}
InsetMathNest::validate(features);
}

View File

@ -80,8 +80,8 @@ docstring InsetMathDots::name() const
void InsetMathDots::validate(LaTeXFeatures & features) const
{
if (!key_->requires.empty())
features.require(key_->requires);
if (!key_->required.empty())
features.require(key_->required);
}

View File

@ -644,7 +644,7 @@ void InsetMathMacro::updateRepresentation(Cursor * cur, MacroContext const & mc,
d->nesting_ = nesting;
// update requires
d->requires_ = d->macro_->requires();
d->requires_ = d->macro_->required();
if (!d->needsUpdate_
// non-normal mode? We are done!
@ -911,8 +911,8 @@ void InsetMathMacro::validate(LaTeXFeatures & features) const
else if (!d->macro_) {
// Update requires for known global macros.
MacroData const * data = MacroTable::globalMacros().get(name());
if (data && !data->requires().empty())
features.require(data->requires());
if (data && !data->required().empty())
features.require(data->required());
}
if (name() == "binom")

View File

@ -247,8 +247,8 @@ void InsetMathSymbol::validate(LaTeXFeatures & features) const
"sub.limit{font-size: 75%;}\n"
"sup.limit{font-size: 75%;}");
} else {
if (!sym_->requires.empty())
features.require(sym_->requires);
if (!sym_->required.empty())
features.require(sym_->required);
}
}

View File

@ -110,10 +110,10 @@ vector<docstring> const & MacroData::defaults() const
}
string const MacroData::requires() const
string const MacroData::required() const
{
if (sym_)
return sym_->requires;
return sym_->required;
return string();
}

View File

@ -60,7 +60,7 @@ public:
///
std::vector<docstring> const & defaults() const;
///
std::string const requires() const;
std::string const required() const;
///
bool hidden() const;
///

View File

@ -217,7 +217,7 @@ void initSymbols()
requires = "";
tmp.hidden = hidden = true;
} else
tmp.requires = requires;
tmp.required = requires;
theMathWordList[it->first] = tmp;
wit = theMathWordList.find(it->first);
it->second.setSymbol(&(wit->second));
@ -249,9 +249,9 @@ void initSymbols()
if ((is >> help)) {
// backward compatibility
if (help == "esintoramsmath")
tmp.requires = "esint|amsmath";
tmp.required = "esint|amsmath";
else
tmp.requires = to_ascii(help);
tmp.required = to_ascii(help);
}
} else {
LYXERR(Debug::MATHED, "skipping line '" << line << "'\n"
@ -265,13 +265,13 @@ void initSymbols()
// create fallbacks if necessary
// store requirements as long as we can
if (tmp.requires.empty()) {
if (tmp.required.empty()) {
if (tmp.inset == "msa" || tmp.inset == "msb")
tmp.requires = "amssymb";
tmp.required = "amssymb";
else if (tmp.inset == "wasy")
tmp.requires = "wasysym";
tmp.required = "wasysym";
else if (tmp.inset == "mathscr")
tmp.requires = "mathrsfs";
tmp.required = "mathrsfs";
}
// symbol font is not available sometimes
@ -307,9 +307,9 @@ void initSymbols()
<< " used for " << to_utf8(tmp.name));
}
if (tmp.requires == "hiddensymbol")
if (tmp.required == "hiddensymbol")
{
tmp.requires = "";
tmp.required = "";
tmp.hidden = true;
}
@ -326,7 +326,7 @@ void initSymbols()
<< " draw: " << int(tmp.draw.empty() ? 0 : tmp.draw[0])
<< " extra: " << to_utf8(tmp.extra)
<< " xml: " << to_utf8(tmp.xmlname)
<< " requires: " << tmp.requires
<< " requires: " << tmp.required
<< " hidden: " << tmp.hidden << '\'');
}
string tmp = "cmm";

View File

@ -57,7 +57,7 @@ public:
/// how is this called as XML entity in MathML?
docstring xmlname;
/// required LaTeXFeatures
std::string requires;
std::string required;
/// Should this macro be hidden from autocompletion (since it requires
/// user preamble code)?
bool hidden;

View File

@ -1024,7 +1024,7 @@ void validate_math_word(LaTeXFeatures & features, docstring const & word)
MathWordList const & words = mathedWordList();
MathWordList::const_iterator it = words.find(word);
if (it != words.end()) {
string const req = it->second.requires;
string const req = it->second.required;
if (!req.empty())
features.require(req);
}