diff --git a/src/mathed/Makefile.am b/src/mathed/Makefile.am index 68d7c6dbc3..ee2683fc12 100644 --- a/src/mathed/Makefile.am +++ b/src/mathed/Makefile.am @@ -60,6 +60,8 @@ libmathed_la_SOURCES = \ math_gridinset.C \ math_gridinset.h \ math_hash.C \ + math_hullinset.C \ + math_hullinset.h \ math_inset.C \ math_inset.h \ math_kerninset.C \ @@ -76,8 +78,6 @@ libmathed_la_SOURCES = \ math_macrotable.h \ math_mathmlstream.C \ math_mathmlstream.h \ - math_matrixinset.C \ - math_matrixinset.h \ math_metricsinfo.h \ math_metricsinfo.C \ math_nestinset.C \ diff --git a/src/mathed/formula.C b/src/mathed/formula.C index e596cf6b0c..cc01ef14f9 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -40,7 +40,7 @@ #include "LyXView.h" #include "Painter.h" #include "lyxrc.h" -#include "math_matrixinset.h" +#include "math_hullinset.h" #include "math_support.h" #include "math_mathmlstream.h" @@ -248,12 +248,12 @@ namespace { InsetFormula::InsetFormula() - : par_(MathAtom(new MathMatrixInset)) + : par_(MathAtom(new MathHullInset)) {} InsetFormula::InsetFormula(MathInsetTypes t) - : par_(MathAtom(new MathMatrixInset(t))) + : par_(MathAtom(new MathHullInset(t))) {} @@ -267,7 +267,7 @@ InsetFormula::InsetFormula(string const & s) if (!res) { lyxerr << "cannot interpret '" << s << "' as math\n"; - par_ = MathAtom(new MathMatrixInset(LM_OT_SIMPLE)); + par_ = MathAtom(new MathHullInset(LM_OT_SIMPLE)); } } metrics(); @@ -537,14 +537,14 @@ bool InsetFormula::display() const } -MathMatrixInset const * InsetFormula::mat() const +MathHullInset const * InsetFormula::mat() const { lyx::Assert(par_->asMatrixInset()); return par_->asMatrixInset(); } -MathMatrixInset * InsetFormula::mat() +MathHullInset * InsetFormula::mat() { lyx::Assert(par_->asMatrixInset()); return par_->asMatrixInset(); diff --git a/src/mathed/formula.h b/src/mathed/formula.h index 38b41cbccb..f0b57150d9 100644 --- a/src/mathed/formula.h +++ b/src/mathed/formula.h @@ -25,7 +25,7 @@ #include "math_defs.h" #include "math_atom.h" -class MathMatrixInset; +class MathHullInset; /// class InsetFormula : public InsetFormulaBase { @@ -87,8 +87,8 @@ public: MathAtom par_; /// Access - MathMatrixInset * mat(); + MathHullInset * mat(); /// Access - MathMatrixInset const * mat() const; + MathHullInset const * mat() const; }; #endif diff --git a/src/mathed/formulamacro.C b/src/mathed/formulamacro.C index cd2b108c24..bd50d8c087 100644 --- a/src/mathed/formulamacro.C +++ b/src/mathed/formulamacro.C @@ -25,7 +25,7 @@ #include "math_macroarg.h" #include "math_macrotable.h" #include "math_macrotemplate.h" -#include "math_matrixinset.h" +#include "math_hullinset.h" #include "lyx_main.h" #include "BufferView.h" #include "gettext.h" diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index c067780707..a19c107275 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -36,7 +36,7 @@ #include "math_braceinset.h" #include "math_charinset.h" #include "math_deliminset.h" -#include "math_matrixinset.h" +#include "math_hullinset.h" #include "math_scriptinset.h" #include "math_spaceinset.h" #include "math_specialcharinset.h" @@ -1091,7 +1091,7 @@ void MathCursor::breakLine() while (popRight()) ; - MathMatrixInset * p = formula()->par()->asMatrixInset(); + MathHullInset * p = formula()->par()->asMatrixInset(); if (!p) return; @@ -1105,8 +1105,8 @@ void MathCursor::breakLine() // split line const row_type r = row(); for (col_type c = col() + 1; c < p->ncols(); ++c) { - const MathMatrixInset::idx_type i1 = p->index(r, c); - const MathMatrixInset::idx_type i2 = p->index(r + 1, c); + const MathHullInset::idx_type i1 = p->index(r, c); + const MathHullInset::idx_type i2 = p->index(r + 1, c); //lyxerr << "swapping cells " << i1 << " and " << i2 << "\n"; p->cell(i1).swap(p->cell(i2)); } diff --git a/src/mathed/math_cursor.h b/src/mathed/math_cursor.h index 7b533306c6..e0f9649a42 100644 --- a/src/mathed/math_cursor.h +++ b/src/mathed/math_cursor.h @@ -29,7 +29,7 @@ class MathInset; class MathAtom; class MathArrayInset; class MathFuncInset; -class MathMatrixInset; +class MathHullInset; class MathScriptInset; class MathSpaceInset; class InsetFormulaBase; diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index dc9020cc07..5d8098e8bd 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -43,7 +43,7 @@ class MathBoxInset; class MathCharInset; class MathGridInset; class MathNestInset; -class MathMatrixInset; +class MathHullInset; class MathScriptInset; class MathSpaceInset; class MathMacroTemplate; @@ -169,9 +169,9 @@ public: /// identifies ScriptInsets virtual MathScriptInset * asScriptInset() { return 0; } /// identifies MatrixInsets - virtual MathMatrixInset const * asMatrixInset() const { return 0; } + virtual MathHullInset const * asMatrixInset() const { return 0; } /// identifies MatrixInsets - virtual MathMatrixInset * asMatrixInset() { return 0; } + virtual MathHullInset * asMatrixInset() { return 0; } /// identifies SpaceInset virtual MathSpaceInset * asSpaceInset() { return 0; } /// identifies GridInset diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 1266efc819..4da7787d9c 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -65,7 +65,7 @@ point to write some macros: #include "math_macro.h" #include "math_macrotable.h" #include "math_macrotemplate.h" -#include "math_matrixinset.h" +#include "math_hullinset.h" #include "math_rootinset.h" #include "math_sqrtinset.h" #include "math_scriptinset.h" @@ -493,7 +493,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost) } if (outmost) { - MathMatrixInset * m = t->asMatrixInset(); + MathHullInset * m = t->asMatrixInset(); if (!m) { lyxerr << "error in Parser::parse_lines() 2\n"; return false; @@ -570,7 +570,7 @@ bool Parser::parse_normal(MathAtom & matrix) Token const & t = getToken(); if (t.cs() == "(") { - matrix = MathAtom(new MathMatrixInset(LM_OT_SIMPLE)); + matrix = MathAtom(new MathHullInset(LM_OT_SIMPLE)); parse_into(matrix->cell(0), 0); return true; } @@ -579,15 +579,15 @@ bool Parser::parse_normal(MathAtom & matrix) Token const & n = getToken(); if (n.cat() == catMath) { // TeX's $$...$$ syntax for displayed math - matrix = MathAtom(new MathMatrixInset(LM_OT_EQUATION)); - MathMatrixInset * p = matrix->asMatrixInset(); + matrix = MathAtom(new MathHullInset(LM_OT_EQUATION)); + MathHullInset * p = matrix->asMatrixInset(); parse_into(p->cell(0), 0); p->numbered(0, curr_num_); p->label(0, curr_label_); } else { // simple $...$ stuff putback(); - matrix = MathAtom(new MathMatrixInset(LM_OT_SIMPLE)); + matrix = MathAtom(new MathHullInset(LM_OT_SIMPLE)); parse_into(matrix->cell(0), 0); } return true; @@ -603,8 +603,8 @@ bool Parser::parse_normal(MathAtom & matrix) if (cs == "[") { curr_num_ = 0; curr_label_.erase(); - matrix = MathAtom(new MathMatrixInset(LM_OT_EQUATION)); - MathMatrixInset * p = matrix->asMatrixInset(); + matrix = MathAtom(new MathHullInset(LM_OT_EQUATION)); + MathHullInset * p = matrix->asMatrixInset(); parse_into(p->cell(0), 0); p->numbered(0, curr_num_); p->label(0, curr_label_); @@ -621,8 +621,8 @@ bool Parser::parse_normal(MathAtom & matrix) if (name == "equation" || name == "equation*" || name == "displaymath") { curr_num_ = (name == "equation"); curr_label_.erase(); - matrix = MathAtom(new MathMatrixInset(LM_OT_EQUATION)); - MathMatrixInset * p = matrix->asMatrixInset(); + matrix = MathAtom(new MathHullInset(LM_OT_EQUATION)); + MathHullInset * p = matrix->asMatrixInset(); parse_into(p->cell(0), FLAG_END); p->numbered(0, curr_num_); p->label(0, curr_label_); @@ -630,40 +630,40 @@ bool Parser::parse_normal(MathAtom & matrix) } if (name == "eqnarray" || name == "eqnarray*") { - matrix = MathAtom(new MathMatrixInset(LM_OT_EQNARRAY)); + matrix = MathAtom(new MathHullInset(LM_OT_EQNARRAY)); return parse_lines(matrix, !stared(name), true); } if (name == "align" || name == "align*") { - matrix = MathAtom(new MathMatrixInset(LM_OT_ALIGN)); + matrix = MathAtom(new MathHullInset(LM_OT_ALIGN)); return parse_lines(matrix, !stared(name), true); } if (name == "alignat" || name == "alignat*") { int nc = 2 * atoi(getArg('{', '}').c_str()); - matrix = MathAtom(new MathMatrixInset(LM_OT_ALIGNAT, nc)); + matrix = MathAtom(new MathHullInset(LM_OT_ALIGNAT, nc)); return parse_lines(matrix, !stared(name), true); } if (name == "xalignat" || name == "xalignat*") { int nc = 2 * atoi(getArg('{', '}').c_str()); - matrix = MathAtom(new MathMatrixInset(LM_OT_XALIGNAT, nc)); + matrix = MathAtom(new MathHullInset(LM_OT_XALIGNAT, nc)); return parse_lines(matrix, !stared(name), true); } if (name == "xxalignat") { int nc = 2 * atoi(getArg('{', '}').c_str()); - matrix = MathAtom(new MathMatrixInset(LM_OT_XXALIGNAT, nc)); + matrix = MathAtom(new MathHullInset(LM_OT_XXALIGNAT, nc)); return parse_lines(matrix, !stared(name), true); } if (name == "multline" || name == "multline*") { - matrix = MathAtom(new MathMatrixInset(LM_OT_MULTLINE)); + matrix = MathAtom(new MathHullInset(LM_OT_MULTLINE)); return parse_lines(matrix, !stared(name), true); } if (name == "gather" || name == "gather*") { - matrix = MathAtom(new MathMatrixInset(LM_OT_GATHER)); + matrix = MathAtom(new MathHullInset(LM_OT_GATHER)); return parse_lines(matrix, !stared(name), true); } diff --git a/src/mathed/math_parser.h b/src/mathed/math_parser.h index e49a4f7ce6..8fe33a3a11 100644 --- a/src/mathed/math_parser.h +++ b/src/mathed/math_parser.h @@ -26,7 +26,7 @@ #include "LString.h" #include "math_defs.h" -class MathMatrixInset; +class MathHullInset; class MathMacroTemplate; class MathAtom; class MathArray;