]> git.lyx.org Git - lyx.git/commitdiff
s/requires_/required_/ for code consistency
authorRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 4 May 2020 18:05:44 +0000 (14:05 -0400)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 4 May 2020 18:05:44 +0000 (14:05 -0400)
src/LaTeXFonts.cpp
src/LaTeXFonts.h
src/Language.cpp
src/Language.h
src/Layout.cpp
src/Layout.h
src/TextClass.cpp
src/TextClass.h
src/insets/InsetLayout.cpp
src/insets/InsetLayout.h
src/mathed/InsetMathMacro.cpp

index b52a8c06d5e9c94bf96808fc4aa1f0f21f39a974..12c0856c5db4c7bd1e16ef4b388bb070715d239b 100644 (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_;
index 481c2f78cb4f48e40ccdf2d2916a4a53a234581f..79bd34b7ecdd90de88d7e4e7b0f16e4d3f3b4682 100644 (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_;
        ///
index 809e04bcfb8ebe1ec153f8141cfd11560d713da3..9b176286c80fc6a506c8f2b1da966b3588696307 100644 (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_;
index 2e03644139c5bccff5b20e9c5977f04e443b09d9..c81097472790fc1f2bc813a3c4fa9bd36452e6bc 100644 (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_;
        ///
index 3ed2ddf6c8d8cc4a0bd354a1c8fb3389ca39e99a..877464f240b74c5856525e73d03983027cf864d6 100644 (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;
                }
index edb9ba7f18b02d6bc14defb47f7d9f7d0ff3e3a9..ffc976d8ff7df98c00f2836d14a896e1bc24af78 100644 (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
index 0f3273e152dd49a28767c1e60392573871c40387..c22e7ae1263303fe3163340ca7d006529e9a7636 100644 (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;
                }
 
index 64fa9aa127a7ef2b8b7773ac1ee63221e09a12b8..65891397b95f6427181062b0abdf390199bb82b8 100644 (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_; }
index 8df2ca5e8b7805a4473f7baccb283721c4aef345..7bb8b175f1317215da234f617ac0c13fc3506071 100644 (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:
index 8f3099438a08472c2d5990e470cd1a5867e97316..3bab0a48981e19b8369b33a2430b5ed6e31bcf2b 100644 (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_;
        ///
index d296130fafb0368a39b4f842a3377fcd095b1b96..bdf86258c710a06bfef8a272fa24b8088a097333 100644 (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());