mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
small interface cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3851 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
593247d98a
commit
28fa90eda0
@ -47,10 +47,10 @@ InsetFormulaMacro::InsetFormulaMacro()
|
||||
}
|
||||
|
||||
|
||||
InsetFormulaMacro::InsetFormulaMacro(string name, int nargs)
|
||||
InsetFormulaMacro::InsetFormulaMacro(string const & name, int nargs)
|
||||
{
|
||||
setInsetName(name);
|
||||
MathMacroTable::create(name, nargs, string());
|
||||
MathMacroTable::create(name, nargs);
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
///
|
||||
InsetFormulaMacro();
|
||||
/// construct a macro hull from its name and the number of arguments
|
||||
explicit InsetFormulaMacro(string name, int na);
|
||||
explicit InsetFormulaMacro(string const & name, int nargs);
|
||||
/// constructs a mocro from its LaTeX definition
|
||||
explicit InsetFormulaMacro(string const & s);
|
||||
///
|
||||
|
@ -47,10 +47,17 @@ MathAtom & MathMacroTable::provide(string const & name)
|
||||
}
|
||||
|
||||
|
||||
void MathMacroTable::create(string const & name, int na)
|
||||
{
|
||||
macro_table[name] = MathAtom(new MathMacroTemplate(name, na));
|
||||
}
|
||||
|
||||
|
||||
void MathMacroTable::create(string const & name, int na, string const & text)
|
||||
{
|
||||
MathAtom t(new MathMacroTemplate(name, na));
|
||||
mathed_parse_cell(t->cell(0), text);
|
||||
mathed_parse_cell(t->cell(0), name);
|
||||
mathed_parse_cell(t->cell(1), text);
|
||||
macro_table[name] = t;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ class MathArray;
|
||||
struct MathMacroTable {
|
||||
public:
|
||||
///
|
||||
static void create(string const &, int, string const &);
|
||||
static void create(string const &, int);
|
||||
///
|
||||
static void create(string const &, int, MathArray const &, MathArray const &);
|
||||
///
|
||||
@ -25,13 +25,15 @@ public:
|
||||
static bool has(string const &);
|
||||
///
|
||||
static void builtinMacros();
|
||||
///
|
||||
static void dump();
|
||||
private:
|
||||
/// create internal macros (like \longrightarrow...)
|
||||
static void create(string const &, int, string const &);
|
||||
|
||||
///
|
||||
typedef std::map<string, MathAtom> table_type;
|
||||
//
|
||||
static table_type macro_table;
|
||||
public:
|
||||
///
|
||||
static void dump();
|
||||
};
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user