Now we write again \begin{align} instead of \begin{4} to .lyx and .tex.
* src/mathed/InsetMathHull.C
(InsetMathHull::header_write): write type name, not type_.
Use switch instead of if for better readability.
(InsetMathHull::footer_write): ditto
(InsetMathHull::mutate): write type name, not type_
(InsetMathHull::normalize): ditto
(InsetMathHull::infoize): ditto
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15204
a592a061-630c-0410-9148-
cb99ea01b6c8
{
bool n = numberedType();
{
bool n = numberedType();
- if (type_ == hullNone)
- ;
+ switch(type_) {
+ case hullNone:
+ break;
- else if (type_ == hullSimple) {
os << '$';
if (cell(0).empty())
os << ' ';
os << '$';
if (cell(0).empty())
os << ' ';
- else if (type_ == hullEquation) {
if (n)
os << "\\begin{equation" << star(n) << "}\n";
else
os << "\\[\n";
if (n)
os << "\\begin{equation" << star(n) << "}\n";
else
os << "\\[\n";
- else if (type_ == hullEqnArray || type_ == hullAlign || type_ ==
-hullFlAlign
- || type_ == hullGather || type_ == hullMultline)
- os << "\\begin{" << type_ << star(n) << "}\n";
+ case hullEqnArray:
+ case hullAlign:
+ case hullFlAlign:
+ case hullGather:
+ case hullMultline:
+ os << "\\begin{" << hullName(type_) << star(n) << "}\n";
+ break;
- else if (type_ == hullAlignAt || type_ == hullXAlignAt)
- os << "\\begin{" << type_ << star(n) << '}'
+ case hullAlignAt:
+ case hullXAlignAt:
+ os << "\\begin{" << hullName(type_) << star(n) << '}'
<< '{' << static_cast<unsigned int>((ncols() + 1)/2) << "}\n";
<< '{' << static_cast<unsigned int>((ncols() + 1)/2) << "}\n";
- else if (type_ == hullXXAlignAt)
- os << "\\begin{" << type_ << '}'
+ case hullXXAlignAt:
+ os << "\\begin{" << hullName(type_) << '}'
<< '{' << static_cast<unsigned int>((ncols() + 1)/2) << "}\n";
<< '{' << static_cast<unsigned int>((ncols() + 1)/2) << "}\n";
os << "\\begin{unknown" << star(n) << '}';
os << "\\begin{unknown" << star(n) << '}';
{
bool n = numberedType();
{
bool n = numberedType();
+ switch(type_) {
+ case hullNone:
- else if (type_ == hullSimple)
- else if (type_ == hullEquation)
if (n)
os << "\\end{equation" << star(n) << "}\n";
else
os << "\\]\n";
if (n)
os << "\\end{equation" << star(n) << "}\n";
else
os << "\\]\n";
- else if (type_ == hullEqnArray || type_ == hullAlign || type_ ==
-hullFlAlign
- || type_ == hullAlignAt || type_ == hullXAlignAt
- || type_ == hullGather || type_ == hullMultline)
- os << "\\end{" << type_ << star(n) << "}\n";
+ case hullEqnArray:
+ case hullAlign:
+ case hullFlAlign:
+ case hullAlignAt:
+ case hullXAlignAt:
+ case hullGather:
+ case hullMultline:
+ os << "\\end{" << hullName(type_) << star(n) << "}\n";
+ break;
- else if (type_ == hullXXAlignAt)
- os << "\\end{" << type_ << "}\n";
+ case hullXXAlignAt:
+ os << "\\end{" << hullName(type_) << "}\n";
+ break;
os << "\\end{unknown" << star(n) << '}';
os << "\\end{unknown" << star(n) << '}';
- lyxerr << "mutation from '" << type_
- << "' to '" << newtype << "' not implemented" << endl;
+ lyxerr << "mutation from '" << hullName(type_)
+ << "' to '" << hullName(newtype)
+ << "' not implemented" << endl;
void InsetMathHull::normalize(NormalStream & os) const
{
void InsetMathHull::normalize(NormalStream & os) const
{
- os << "[formula " << type_ << ' ';
+ os << "[formula " << hullName(type_) << ' ';
InsetMathGrid::normalize(os);
os << "] ";
}
InsetMathGrid::normalize(os);
os << "] ";
}
void InsetMathHull::infoize(ostream & os) const
{
void InsetMathHull::infoize(ostream & os) const
{
- os << "Type: " << type_;
+ os << "Type: " << hullName(type_);