]> git.lyx.org Git - features.git/commitdiff
Renaming cleanup/updateMacros2
authorRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 9 Nov 2020 22:29:27 +0000 (17:29 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 9 Nov 2020 22:29:27 +0000 (17:29 -0500)
src/Buffer.cpp
src/mathed/InsetMathMacro.cpp
src/mathed/InsetMathNest.cpp
src/mathed/MacroTable.cpp
src/mathed/MacroTable.h
src/mathed/MathFactory.cpp

index b6b742baf943e2f023d03dca4f6756307c46071d..c541be9ca06dc10db54b376c094f91b20a4a7498 100644 (file)
@@ -3690,7 +3690,7 @@ MacroData const * Buffer::getMacro(docstring const & name,
        }
 
        if (global) {
-               data = MacroTable::get().getMacro(name);
+               data = GlobalMacros::get().getMacro(name);
                if (data != nullptr)
                        return data;
        }
index 600562f2fcbe58ca80ec9723d4c18a38d1888489..c051c8ed0bb9a73197c31642c1582cf6d135a301 100644 (file)
@@ -938,7 +938,7 @@ MacroData const * InsetMathMacro::macroBackup() const
 {
        if (macro())
                return &d->macroBackup_;
-       if (MacroData const * data = MacroTable::get().getMacro(name()))
+       if (MacroData const * data = GlobalMacros::get().getMacro(name()))
                return data;
        return nullptr;
 }
@@ -957,7 +957,7 @@ void InsetMathMacro::validate(LaTeXFeatures & features) const
                features.require(d->required_);
        else if (!d->macro_) {
                // Update requires for known global macros.
-               MacroData const * data = MacroTable::get().getMacro(name());
+               MacroData const * data = GlobalMacros::get().getMacro(name());
                if (data && !data->required().empty())
                        features.require(data->required());
        }
index 19aa745d50b193d644d11e00305b9412100b0a11..ee4cf77fe00b72c4578a68105a01326e6c0c7467 100644 (file)
@@ -2106,7 +2106,7 @@ MathCompletionList::MathCompletionList(Cursor const & cur)
 
        // fill in global macros
        macros.clear();
-       MacroTable::get().getMacroNames(macros, false);
+       GlobalMacros::get().getMacroNames(macros, false);
        //lyxerr << "Globals completion macros: ";
        for (it = macros.begin(); it != macros.end(); ++it) {
                //lyxerr << "\\" + *it << " ";
index 2bc427b221c20f7a9cd74fe304cd7e92ae30c56f..e6daac67e0069b284a68d734a3aba68147e1bca2 100644 (file)
@@ -215,22 +215,22 @@ int MacroData::write(odocstream & os, bool overwriteRedefinition) const
 //
 /////////////////////////////////////////////////////////////////////
 
-MacroTable & MacroTable::get()
+GlobalMacros & GlobalMacros::get()
 {
-       static MacroTable theGlobalMacros;
+       static GlobalMacros theGlobalMacros;
        return theGlobalMacros;
 }
 
 
-MacroData const * MacroTable::getMacro(docstring const & name) const
+MacroData const * GlobalMacros::getMacro(docstring const & name) const
 {
        const_iterator it = find(name);
        return it == end() ? 0 : &it->second;
 }
 
 
-MacroTable::iterator
-MacroTable::insert(docstring const & name, MacroData const & data)
+GlobalMacros::iterator
+GlobalMacros::insert(docstring const & name, MacroData const & data)
 {
        //lyxerr << "MacroTable::insert: " << to_utf8(name) << endl;
        iterator it = find(name);
@@ -243,8 +243,8 @@ MacroTable::insert(docstring const & name, MacroData const & data)
 }
 
 
-MacroTable::iterator
-MacroTable::insert(Buffer * buf, docstring const & definition)
+GlobalMacros::iterator
+GlobalMacros::insert(Buffer * buf, docstring const & definition)
 {
        //lyxerr << "MacroTable::insert, def: " << to_utf8(def) << endl;
        InsetMathMacroTemplate mac(buf);
@@ -254,7 +254,7 @@ MacroTable::insert(Buffer * buf, docstring const & definition)
 }
 
 
-void MacroTable::getMacroNames(std::set<docstring> & names, bool gethidden) const
+void GlobalMacros::getMacroNames(std::set<docstring> & names, bool gethidden) const
 {
        for (const_iterator it = begin(); it != end(); ++it)
                if (gethidden || !it->second.hidden())
@@ -262,7 +262,7 @@ void MacroTable::getMacroNames(std::set<docstring> & names, bool gethidden) cons
 }
 
 
-void MacroTable::dump()
+void GlobalMacros::dump()
 {
        lyxerr << "\n------------------------------------------" << endl;
        for (const_iterator it = begin(); it != end(); ++it)
index a6996da40e2df281cec817ba0afa7792e7176ab4..0d5e4a241b1937025e520af6b960b860b6787e36 100644 (file)
@@ -168,15 +168,15 @@ class MacroSet : public std::set<MacroData const *> {};
  * hack to display certain contents nicely.
  *
  **/
-class MacroTable : public std::map<docstring, MacroData>
+class GlobalMacros : public std::map<docstring, MacroData>
 {
 public:
        /// We are a singleton
-       MacroTable() = default;
-       MacroTable(MacroTable const &) = delete;
-       void operator=(MacroTable const &) = delete;
+       GlobalMacros() = default;
+       GlobalMacros(GlobalMacros const &) = delete;
+       void operator=(GlobalMacros const &) = delete;
        /// the global list: our unique instance
-       static MacroTable & get();
+       static GlobalMacros & get();
        /// Parse full "\\def..." or "\\newcommand..." or ...
        iterator insert(Buffer * buf, docstring const & definition);
        /// Insert pre-digested macro definition
index f9569737f66b6fcd094f5f287a9fdbc1ef850833..49baa5dc19e5615bec080aaf06ac2ba22da0d4cd 100644 (file)
@@ -202,7 +202,7 @@ void initSymbols()
                                        required = "";
                        } else
                                htmlname = xmlname = "";
-                       MacroTable::iterator it = MacroTable::get().insert(
+                       GlobalMacros::iterator it = GlobalMacros::get().insert(
                                        0, from_utf8(macro));
                        if (!extra.empty() || !htmlname.empty() || !xmlname.empty() || !required.empty()) {
                                MathWordList::iterator wit = theMathWordList.find(it->first);