cosmetics: rename "matrix" into "hull" since it is used only for the

outermost math inset in a formula and not for matrices at all...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2986 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-11-08 12:28:33 +00:00
parent 1b787e207d
commit 15b1e9cdde
9 changed files with 38 additions and 38 deletions

View File

@ -60,6 +60,8 @@ libmathed_la_SOURCES = \
math_gridinset.C \ math_gridinset.C \
math_gridinset.h \ math_gridinset.h \
math_hash.C \ math_hash.C \
math_hullinset.C \
math_hullinset.h \
math_inset.C \ math_inset.C \
math_inset.h \ math_inset.h \
math_kerninset.C \ math_kerninset.C \
@ -76,8 +78,6 @@ libmathed_la_SOURCES = \
math_macrotable.h \ math_macrotable.h \
math_mathmlstream.C \ math_mathmlstream.C \
math_mathmlstream.h \ math_mathmlstream.h \
math_matrixinset.C \
math_matrixinset.h \
math_metricsinfo.h \ math_metricsinfo.h \
math_metricsinfo.C \ math_metricsinfo.C \
math_nestinset.C \ math_nestinset.C \

View File

@ -40,7 +40,7 @@
#include "LyXView.h" #include "LyXView.h"
#include "Painter.h" #include "Painter.h"
#include "lyxrc.h" #include "lyxrc.h"
#include "math_matrixinset.h" #include "math_hullinset.h"
#include "math_support.h" #include "math_support.h"
#include "math_mathmlstream.h" #include "math_mathmlstream.h"
@ -248,12 +248,12 @@ namespace {
InsetFormula::InsetFormula() InsetFormula::InsetFormula()
: par_(MathAtom(new MathMatrixInset)) : par_(MathAtom(new MathHullInset))
{} {}
InsetFormula::InsetFormula(MathInsetTypes t) 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) { if (!res) {
lyxerr << "cannot interpret '" << s << "' as math\n"; lyxerr << "cannot interpret '" << s << "' as math\n";
par_ = MathAtom(new MathMatrixInset(LM_OT_SIMPLE)); par_ = MathAtom(new MathHullInset(LM_OT_SIMPLE));
} }
} }
metrics(); metrics();
@ -537,14 +537,14 @@ bool InsetFormula::display() const
} }
MathMatrixInset const * InsetFormula::mat() const MathHullInset const * InsetFormula::mat() const
{ {
lyx::Assert(par_->asMatrixInset()); lyx::Assert(par_->asMatrixInset());
return par_->asMatrixInset(); return par_->asMatrixInset();
} }
MathMatrixInset * InsetFormula::mat() MathHullInset * InsetFormula::mat()
{ {
lyx::Assert(par_->asMatrixInset()); lyx::Assert(par_->asMatrixInset());
return par_->asMatrixInset(); return par_->asMatrixInset();

View File

@ -25,7 +25,7 @@
#include "math_defs.h" #include "math_defs.h"
#include "math_atom.h" #include "math_atom.h"
class MathMatrixInset; class MathHullInset;
/// ///
class InsetFormula : public InsetFormulaBase { class InsetFormula : public InsetFormulaBase {
@ -87,8 +87,8 @@ public:
MathAtom par_; MathAtom par_;
/// Access /// Access
MathMatrixInset * mat(); MathHullInset * mat();
/// Access /// Access
MathMatrixInset const * mat() const; MathHullInset const * mat() const;
}; };
#endif #endif

View File

@ -25,7 +25,7 @@
#include "math_macroarg.h" #include "math_macroarg.h"
#include "math_macrotable.h" #include "math_macrotable.h"
#include "math_macrotemplate.h" #include "math_macrotemplate.h"
#include "math_matrixinset.h" #include "math_hullinset.h"
#include "lyx_main.h" #include "lyx_main.h"
#include "BufferView.h" #include "BufferView.h"
#include "gettext.h" #include "gettext.h"

View File

@ -36,7 +36,7 @@
#include "math_braceinset.h" #include "math_braceinset.h"
#include "math_charinset.h" #include "math_charinset.h"
#include "math_deliminset.h" #include "math_deliminset.h"
#include "math_matrixinset.h" #include "math_hullinset.h"
#include "math_scriptinset.h" #include "math_scriptinset.h"
#include "math_spaceinset.h" #include "math_spaceinset.h"
#include "math_specialcharinset.h" #include "math_specialcharinset.h"
@ -1091,7 +1091,7 @@ void MathCursor::breakLine()
while (popRight()) while (popRight())
; ;
MathMatrixInset * p = formula()->par()->asMatrixInset(); MathHullInset * p = formula()->par()->asMatrixInset();
if (!p) if (!p)
return; return;
@ -1105,8 +1105,8 @@ void MathCursor::breakLine()
// split line // split line
const row_type r = row(); const row_type r = row();
for (col_type c = col() + 1; c < p->ncols(); ++c) { for (col_type c = col() + 1; c < p->ncols(); ++c) {
const MathMatrixInset::idx_type i1 = p->index(r, c); const MathHullInset::idx_type i1 = p->index(r, c);
const MathMatrixInset::idx_type i2 = p->index(r + 1, c); const MathHullInset::idx_type i2 = p->index(r + 1, c);
//lyxerr << "swapping cells " << i1 << " and " << i2 << "\n"; //lyxerr << "swapping cells " << i1 << " and " << i2 << "\n";
p->cell(i1).swap(p->cell(i2)); p->cell(i1).swap(p->cell(i2));
} }

View File

@ -29,7 +29,7 @@ class MathInset;
class MathAtom; class MathAtom;
class MathArrayInset; class MathArrayInset;
class MathFuncInset; class MathFuncInset;
class MathMatrixInset; class MathHullInset;
class MathScriptInset; class MathScriptInset;
class MathSpaceInset; class MathSpaceInset;
class InsetFormulaBase; class InsetFormulaBase;

View File

@ -43,7 +43,7 @@ class MathBoxInset;
class MathCharInset; class MathCharInset;
class MathGridInset; class MathGridInset;
class MathNestInset; class MathNestInset;
class MathMatrixInset; class MathHullInset;
class MathScriptInset; class MathScriptInset;
class MathSpaceInset; class MathSpaceInset;
class MathMacroTemplate; class MathMacroTemplate;
@ -169,9 +169,9 @@ public:
/// identifies ScriptInsets /// identifies ScriptInsets
virtual MathScriptInset * asScriptInset() { return 0; } virtual MathScriptInset * asScriptInset() { return 0; }
/// identifies MatrixInsets /// identifies MatrixInsets
virtual MathMatrixInset const * asMatrixInset() const { return 0; } virtual MathHullInset const * asMatrixInset() const { return 0; }
/// identifies MatrixInsets /// identifies MatrixInsets
virtual MathMatrixInset * asMatrixInset() { return 0; } virtual MathHullInset * asMatrixInset() { return 0; }
/// identifies SpaceInset /// identifies SpaceInset
virtual MathSpaceInset * asSpaceInset() { return 0; } virtual MathSpaceInset * asSpaceInset() { return 0; }
/// identifies GridInset /// identifies GridInset

View File

@ -65,7 +65,7 @@ point to write some macros:
#include "math_macro.h" #include "math_macro.h"
#include "math_macrotable.h" #include "math_macrotable.h"
#include "math_macrotemplate.h" #include "math_macrotemplate.h"
#include "math_matrixinset.h" #include "math_hullinset.h"
#include "math_rootinset.h" #include "math_rootinset.h"
#include "math_sqrtinset.h" #include "math_sqrtinset.h"
#include "math_scriptinset.h" #include "math_scriptinset.h"
@ -493,7 +493,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
} }
if (outmost) { if (outmost) {
MathMatrixInset * m = t->asMatrixInset(); MathHullInset * m = t->asMatrixInset();
if (!m) { if (!m) {
lyxerr << "error in Parser::parse_lines() 2\n"; lyxerr << "error in Parser::parse_lines() 2\n";
return false; return false;
@ -570,7 +570,7 @@ bool Parser::parse_normal(MathAtom & matrix)
Token const & t = getToken(); Token const & t = getToken();
if (t.cs() == "(") { if (t.cs() == "(") {
matrix = MathAtom(new MathMatrixInset(LM_OT_SIMPLE)); matrix = MathAtom(new MathHullInset(LM_OT_SIMPLE));
parse_into(matrix->cell(0), 0); parse_into(matrix->cell(0), 0);
return true; return true;
} }
@ -579,15 +579,15 @@ bool Parser::parse_normal(MathAtom & matrix)
Token const & n = getToken(); Token const & n = getToken();
if (n.cat() == catMath) { if (n.cat() == catMath) {
// TeX's $$...$$ syntax for displayed math // TeX's $$...$$ syntax for displayed math
matrix = MathAtom(new MathMatrixInset(LM_OT_EQUATION)); matrix = MathAtom(new MathHullInset(LM_OT_EQUATION));
MathMatrixInset * p = matrix->asMatrixInset(); MathHullInset * p = matrix->asMatrixInset();
parse_into(p->cell(0), 0); parse_into(p->cell(0), 0);
p->numbered(0, curr_num_); p->numbered(0, curr_num_);
p->label(0, curr_label_); p->label(0, curr_label_);
} else { } else {
// simple $...$ stuff // simple $...$ stuff
putback(); putback();
matrix = MathAtom(new MathMatrixInset(LM_OT_SIMPLE)); matrix = MathAtom(new MathHullInset(LM_OT_SIMPLE));
parse_into(matrix->cell(0), 0); parse_into(matrix->cell(0), 0);
} }
return true; return true;
@ -603,8 +603,8 @@ bool Parser::parse_normal(MathAtom & matrix)
if (cs == "[") { if (cs == "[") {
curr_num_ = 0; curr_num_ = 0;
curr_label_.erase(); curr_label_.erase();
matrix = MathAtom(new MathMatrixInset(LM_OT_EQUATION)); matrix = MathAtom(new MathHullInset(LM_OT_EQUATION));
MathMatrixInset * p = matrix->asMatrixInset(); MathHullInset * p = matrix->asMatrixInset();
parse_into(p->cell(0), 0); parse_into(p->cell(0), 0);
p->numbered(0, curr_num_); p->numbered(0, curr_num_);
p->label(0, curr_label_); p->label(0, curr_label_);
@ -621,8 +621,8 @@ bool Parser::parse_normal(MathAtom & matrix)
if (name == "equation" || name == "equation*" || name == "displaymath") { if (name == "equation" || name == "equation*" || name == "displaymath") {
curr_num_ = (name == "equation"); curr_num_ = (name == "equation");
curr_label_.erase(); curr_label_.erase();
matrix = MathAtom(new MathMatrixInset(LM_OT_EQUATION)); matrix = MathAtom(new MathHullInset(LM_OT_EQUATION));
MathMatrixInset * p = matrix->asMatrixInset(); MathHullInset * p = matrix->asMatrixInset();
parse_into(p->cell(0), FLAG_END); parse_into(p->cell(0), FLAG_END);
p->numbered(0, curr_num_); p->numbered(0, curr_num_);
p->label(0, curr_label_); p->label(0, curr_label_);
@ -630,40 +630,40 @@ bool Parser::parse_normal(MathAtom & matrix)
} }
if (name == "eqnarray" || name == "eqnarray*") { 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); return parse_lines(matrix, !stared(name), true);
} }
if (name == "align" || name == "align*") { 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); return parse_lines(matrix, !stared(name), true);
} }
if (name == "alignat" || name == "alignat*") { if (name == "alignat" || name == "alignat*") {
int nc = 2 * atoi(getArg('{', '}').c_str()); 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); return parse_lines(matrix, !stared(name), true);
} }
if (name == "xalignat" || name == "xalignat*") { if (name == "xalignat" || name == "xalignat*") {
int nc = 2 * atoi(getArg('{', '}').c_str()); 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); return parse_lines(matrix, !stared(name), true);
} }
if (name == "xxalignat") { if (name == "xxalignat") {
int nc = 2 * atoi(getArg('{', '}').c_str()); 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); return parse_lines(matrix, !stared(name), true);
} }
if (name == "multline" || name == "multline*") { 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); return parse_lines(matrix, !stared(name), true);
} }
if (name == "gather" || name == "gather*") { 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); return parse_lines(matrix, !stared(name), true);
} }

View File

@ -26,7 +26,7 @@
#include "LString.h" #include "LString.h"
#include "math_defs.h" #include "math_defs.h"
class MathMatrixInset; class MathHullInset;
class MathMacroTemplate; class MathMacroTemplate;
class MathAtom; class MathAtom;
class MathArray; class MathArray;