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:
André Pönitz 2002-03-27 11:02:56 +00:00
parent 593247d98a
commit 28fa90eda0
4 changed files with 17 additions and 8 deletions

View File

@ -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);
}

View File

@ -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);
///

View File

@ -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;
}

View File

@ -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