Fix bug #2969: Double labels appear on empty lines of multi-line equations.

This reverts part of r10553. There, an extra '//' was added when the last line was empty. However, this really makes an extra line and that is visible when the lines have a line number. The bug #2067 that would have been fixed by this does not seem to 'exist' anymore.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30795 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-07-26 20:25:11 +00:00
parent fc5dec8da5
commit b62b366a67
4 changed files with 7 additions and 8 deletions

View File

@ -633,7 +633,7 @@ void InsetMathGrid::drawT(TextPainter & /*pain*/, int /*x*/, int /*y*/) const
} }
docstring InsetMathGrid::eolString(row_type row, bool emptyline, bool fragile) const docstring InsetMathGrid::eolString(row_type row, bool fragile) const
{ {
docstring eol; docstring eol;
@ -651,7 +651,7 @@ docstring InsetMathGrid::eolString(row_type row, bool emptyline, bool fragile) c
} }
// only add \\ if necessary // only add \\ if necessary
if (eol.empty() && row + 1 == nrows() && (nrows() == 1 || !emptyline)) if (eol.empty() && row + 1 == nrows())
return docstring(); return docstring();
return (fragile ? "\\protect\\\\" : "\\\\") + eol; return (fragile ? "\\protect\\\\" : "\\\\") + eol;
@ -1006,7 +1006,7 @@ void InsetMathGrid::write(WriteStream & os,
ModeSpecifier specifier(os, TEXT_MODE); ModeSpecifier specifier(os, TEXT_MODE);
os << eocString(col, lastcol); os << eocString(col, lastcol);
} }
eol = eolString(row, emptyline, os.fragile()); eol = eolString(row, os.fragile());
os << eol; os << eol;
// append newline only if line wasn't completely empty // append newline only if line wasn't completely empty
// and this was not the last line in the grid // and this was not the last line in the grid

View File

@ -233,8 +233,7 @@ protected:
/// returns y offset of cell compared to inset /// returns y offset of cell compared to inset
int cellYOffset(idx_type idx) const; int cellYOffset(idx_type idx) const;
/// returns proper 'end of line' code for LaTeX /// returns proper 'end of line' code for LaTeX
virtual docstring eolString(row_type row, bool emptyline, virtual docstring eolString(row_type row, bool fragile) const;
bool fragile) const;
/// returns proper 'end of column' code for LaTeX /// returns proper 'end of column' code for LaTeX
virtual docstring eocString(col_type col, col_type lastcol) const; virtual docstring eocString(col_type col, col_type lastcol) const;
/// splits cells and shifts right part to the next cell /// splits cells and shifts right part to the next cell

View File

@ -1034,7 +1034,7 @@ void InsetMathHull::mutate(HullType newtype)
} }
docstring InsetMathHull::eolString(row_type row, bool emptyline, bool fragile) const docstring InsetMathHull::eolString(row_type row, bool fragile) const
{ {
docstring res; docstring res;
if (numberedType()) { if (numberedType()) {
@ -1043,7 +1043,7 @@ docstring InsetMathHull::eolString(row_type row, bool emptyline, bool fragile) c
if (nonum_[row] && (type_ != hullMultline)) if (nonum_[row] && (type_ != hullMultline))
res += "\\nonumber "; res += "\\nonumber ";
} }
return res + InsetMathGrid::eolString(row, emptyline, fragile); return res + InsetMathGrid::eolString(row, fragile);
} }

View File

@ -154,7 +154,7 @@ protected:
bool getStatus(Cursor & cur, FuncRequest const & cmd, bool getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const; FuncStatus & status) const;
/// ///
docstring eolString(row_type row, bool emptyline, bool fragile) const; docstring eolString(row_type row, bool fragile) const;
private: private:
virtual Inset * clone() const; virtual Inset * clone() const;