s/requires_/required_/ for code consistency

This commit is contained in:
Richard Kimberly Heck 2020-05-04 14:05:44 -04:00
parent 3b09ef61a6
commit d6a7ec506e
11 changed files with 36 additions and 36 deletions

View File

@ -48,12 +48,12 @@ bool LaTeXFont::available(bool ot1, bool nomath)
else if (ot1 && !ot1font_.empty())
return (ot1font_ == "none") ?
true : altFont(ot1font_).available(ot1, nomath);
else if (requires_.empty() && package_.empty())
else if (required_.empty() && package_.empty())
return true;
else if (!requires_.empty()
&& LaTeXFeatures::isAvailable(to_ascii(requires_)))
else if (!required_.empty()
&& LaTeXFeatures::isAvailable(to_ascii(required_)))
return true;
else if (requires_.empty() && !package_.empty()
else if (required_.empty() && !package_.empty()
&& LaTeXFeatures::isAvailable(to_ascii(package_)))
return true;
else if (!altfonts_.empty()) {
@ -181,19 +181,19 @@ docstring const LaTeXFont::getUsedFont(bool ot1, bool complete, bool nomath)
&& altFont(completefont_).available(ot1, nomath))
return completefont_;
else if (switchdefault_) {
if (requires_.empty()
|| (!requires_.empty()
&& LaTeXFeatures::isAvailable(to_ascii(requires_))))
if (required_.empty()
|| (!required_.empty()
&& LaTeXFeatures::isAvailable(to_ascii(required_))))
return name_;
}
else if (!requires_.empty()
&& LaTeXFeatures::isAvailable(to_ascii(requires_)))
else if (!required_.empty()
&& LaTeXFeatures::isAvailable(to_ascii(required_)))
return name_;
else if (!package_.empty()
&& LaTeXFeatures::isAvailable(to_ascii(package_)))
return name_;
else if (!preamble_.empty() && package_.empty()
&& requires_.empty() && !switchdefault_
&& required_.empty() && !switchdefault_
&& altfonts_.empty()) {
return name_;
}
@ -224,7 +224,7 @@ string const LaTeXFont::getAvailablePackage(bool dryrun)
return string();
string const package = to_ascii(package_);
if (!requires_.empty() && LaTeXFeatures::isAvailable(to_ascii(requires_)))
if (!required_.empty() && LaTeXFeatures::isAvailable(to_ascii(required_)))
return package;
else if (LaTeXFeatures::isAvailable(package))
return package;
@ -232,7 +232,7 @@ string const LaTeXFont::getAvailablePackage(bool dryrun)
else if (dryrun)
return package;
docstring const req = requires_.empty() ? package_ : requires_;
docstring const req = required_.empty() ? package_ : required_;
frontend::Alert::warning(_("Font not available"),
bformat(_("The LaTeX package `%1$s' needed for the font `%2$s'\n"
"is not available on your system. LyX will fall back to the default font."),
@ -314,7 +314,7 @@ string const LaTeXFont::getLaTeXCode(bool dryrun, bool ot1, bool complete, bool
frontend::Alert::warning(_("Font not available"),
bformat(_("The LaTeX package `%1$s' needed for the font `%2$s'\n"
"is not available on your system. LyX will fall back to the default font."),
requires_, guiname_), true);
required_, guiname_), true);
} else {
string const package =
getAvailablePackage(dryrun);
@ -474,7 +474,7 @@ bool LaTeXFont::readFont(Lexer & lex)
break;
}
case LF_REQUIRES:
lex >> requires_;
lex >> required_;
break;
case LF_SCALEOPTION:
lex >> scaleoption_;

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 & required() { return requires_; }
docstring const & required() { return required_; }
/// Does this font provide a given \p feature
bool provides(std::string const & name, bool ot1,
bool complete, bool nomath);
@ -140,7 +140,7 @@ private:
///
std::vector<std::string> provides_;
///
docstring requires_;
docstring required_;
///
docstring preamble_;
///

View File

@ -258,7 +258,7 @@ bool Language::readLanguage(Lexer & lex)
lex.getLongString(from_ascii("EndPreBabelPreamble"));
break;
case LA_REQUIRES:
lex >> requires_;
lex >> required_;
break;
case LA_PROVIDES:
lex >> provides_;

View File

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

View File

@ -607,7 +607,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
lex.eatLine();
vector<string> const req =
getVectorFromString(lex.getString(true));
requires_.insert(req.begin(), req.end());
required_.insert(req.begin(), req.end());
break;
}
@ -1443,11 +1443,11 @@ void Layout::write(ostream & os) const
case Spacing::Default:
break;
}
if (!requires_.empty()) {
if (!required_.empty()) {
os << "\tRequires ";
for (set<string>::const_iterator it = requires_.begin();
it != requires_.end(); ++it) {
if (it != requires_.begin())
for (set<string>::const_iterator it = required_.begin();
it != required_.end(); ++it) {
if (it != required_.begin())
os << ',';
os << *it;
}

View File

@ -153,7 +153,7 @@ public:
/// this layout for language \p lang
docstring const babelpreamble() const { return babelpreamble_; }
///
std::set<std::string> const & required() const { return requires_; }
std::set<std::string> const & required() const { return required_; }
///
std::set<docstring> const & autonests() const { return autonests_; }
///
@ -483,7 +483,7 @@ private:
/// Are adjacent paragraphs handled as one group?
bool par_group_;
/// Packages needed for this layout
std::set<std::string> requires_;
std::set<std::string> required_;
/// Layouts that are by default nested after this one
std::set<docstring> autonests_;
/// Layouts that by auto-nest this one

View File

@ -686,7 +686,7 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
lexrc.eatLine();
vector<string> const req
= getVectorFromString(lexrc.getString());
requires_.insert(req.begin(), req.end());
required_.insert(req.begin(), req.end());
break;
}

View File

@ -304,7 +304,7 @@ protected:
/// latex packages loaded by document class.
std::set<std::string> provides_;
/// latex packages requested by document class.
std::set<std::string> requires_;
std::set<std::string> required_;
///
std::map<std::string, std::string> package_options_;
/// default modules wanted by document class
@ -490,7 +490,7 @@ public:
/// is this feature already provided by the class?
bool provides(std::string const & p) const;
/// features required by the class?
std::set<std::string> const & required() const { return requires_; }
std::set<std::string> const & required() const { return required_; }
/// package options to write to LaTeX file
std::map<std::string, std::string> const & packageOptions() const
{ return package_options_; }

View File

@ -497,7 +497,7 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass,
lex.eatLine();
vector<string> const req
= getVectorFromString(lex.getString(true));
requires_.insert(req.begin(), req.end());
required_.insert(req.begin(), req.end());
break;
}
case IL_SPELLCHECK:

View File

@ -149,7 +149,7 @@ public:
/// Defaults to true.
bool htmlisblock() const { return htmlisblock_; }
///
std::set<std::string> required() const { return requires_; }
std::set<std::string> required() const { return required_; }
///
bool isMultiPar() const { return multipar_; }
///
@ -276,7 +276,7 @@ private:
///
bool htmlisblock_;
///
std::set<std::string> requires_;
std::set<std::string> required_;
///
bool multipar_;
///

View File

@ -239,7 +239,7 @@ public:
///
mutable std::map<BufferView const *, bool> editing_;
///
std::string requires_;
std::string required_;
/// update macro representation
bool needsUpdate_;
///
@ -644,7 +644,7 @@ void InsetMathMacro::updateRepresentation(Cursor * cur, MacroContext const & mc,
d->nesting_ = nesting;
// update requires
d->requires_ = d->macro_->required();
d->required_ = d->macro_->required();
if (!d->needsUpdate_
// non-normal mode? We are done!
@ -906,8 +906,8 @@ void InsetMathMacro::validate(LaTeXFeatures & features) const
// instant preview is on for math, in which case we will be missing
// the corresponding requirements.
// In this case, we get the required info from the global macro table.
if (!d->requires_.empty())
features.require(d->requires_);
if (!d->required_.empty())
features.require(d->required_);
else if (!d->macro_) {
// Update requires for known global macros.
MacroData const * data = MacroTable::globalMacros().get(name());