}
if (global) {
- data = MacroTable::get().getMacro(name);
+ data = GlobalMacros::get().getMacro(name);
if (data != nullptr)
return data;
}
{
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;
}
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());
}
// 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 << " ";
//
/////////////////////////////////////////////////////////////////////
-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);
}
-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);
}
-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())
}
-void MacroTable::dump()
+void GlobalMacros::dump()
{
lyxerr << "\n------------------------------------------" << endl;
for (const_iterator it = begin(); it != end(); ++it)
* 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
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);