]> git.lyx.org Git - features.git/commitdiff
small interface cleanup
authorAndré Pönitz <poenitz@gmx.net>
Wed, 27 Mar 2002 11:02:56 +0000 (11:02 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 27 Mar 2002 11:02:56 +0000 (11:02 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3851 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/formulamacro.C
src/mathed/formulamacro.h
src/mathed/math_macrotable.C
src/mathed/math_macrotable.h

index 3d048a5b79b9dcdb52d5bf2263f1b98ffe03bd6b..48d87cf4034d14b8e17dff0510a6c949aa7e7ec2 100644 (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);
 }
 
 
index 5fb3b4e1c6571476b3e2094865f1f902575e550a..c9d61785d0470ba71642144713b5301f91e44462 100644 (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);
        ///
index 9d373a71d3afd00a449bfec18070d83a1209e05d..4b948fecaab685abff3bc023f6f7279f04db9526 100644 (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;
 }
 
index 098a85c1480970a891d854ff75ad45cbb04b2257..3400bf915e8fdbb4c2e227bb6eef3d92f25342ec 100644 (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