From 23f483a23e24c2303656998e1065625fa1ad8f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 24 Jun 2002 18:10:01 +0000 Subject: [PATCH] fix #456 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4470 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 7 +++++++ src/mathed/math_gridinset.C | 6 +++--- src/mathed/math_gridinset.h | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 85c7ddd3eb..8dccb70e75 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,10 @@ + +2002-06-24 André Pönitz + + * *.[Ch]: left over changes from Porto + + * math_gridinset.C (eolString): fix #456 + 2002-06-21 John Levon * formula.C: use repaint() diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 65b4868e87..2b6ae2b92e 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -504,7 +504,7 @@ void MathGridInset::drawT(TextPainter & pain, int x, int y) const } -string MathGridInset::eolString(row_type row) const +string MathGridInset::eolString(row_type row, bool fragile) const { string eol; @@ -523,7 +523,7 @@ string MathGridInset::eolString(row_type row) const if (eol.empty() && row + 1 == nrows()) return string(); - return "\\\\" + eol + '\n'; + return (fragile ? "\\protect\\\\" : "\\\\") + eol + '\n'; } @@ -858,7 +858,7 @@ void MathGridInset::write(WriteStream & os) const os << verboseHLine(rowinfo_[row].lines_); for (col_type col = 0; col < ncols(); ++col) os << cell(index(row, col)) << eocString(col); - os << eolString(row); + os << eolString(row, os.fragile()); } string const s = verboseHLine(rowinfo_[nrows()].lines_); if (!s.empty() && s != " ") { diff --git a/src/mathed/math_gridinset.h b/src/mathed/math_gridinset.h index 170748844b..01fddcd8bc 100644 --- a/src/mathed/math_gridinset.h +++ b/src/mathed/math_gridinset.h @@ -203,7 +203,7 @@ public: protected: /// returns proper 'end of line' code for LaTeX - string eolString(row_type row) const; + string eolString(row_type row, bool fragile = false) const; /// returns proper 'end of column' code for LaTeX string eocString(col_type col) const; /// extract number of columns from alignment string