From b720d576c0002e2a1f3a2a1bb27594f4c0a52d7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sun, 2 Dec 2001 17:03:46 +0000 Subject: [PATCH] test add a string operator and comment out a couple of unused args git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3134 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_gridinset.C | 20 ++++++++++---------- src/mathed/math_mathmlstream.C | 17 ++++++++++++++++- src/mathed/math_mathmlstream.h | 7 ++++++- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 4cdb775bae..51668da8f8 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -486,7 +486,7 @@ int MathGridInset::cellYOffset(idx_type idx) const } -bool MathGridInset::idxUp(idx_type & idx, pos_type & pos) const +bool MathGridInset::idxUp(idx_type & /*idx*/, pos_type & /*pos*/) const { return false; /* @@ -500,7 +500,7 @@ bool MathGridInset::idxUp(idx_type & idx, pos_type & pos) const } -bool MathGridInset::idxDown(idx_type & idx, pos_type & pos) const +bool MathGridInset::idxDown(idx_type & /*idx*/, pos_type & /*pos*/) const { return false; /* @@ -519,7 +519,7 @@ bool MathGridInset::idxLeft(idx_type & idx, pos_type & pos) const // leave matrix if on the left hand edge if (col(idx) == 0) return false; - idx--; + --idx; pos = cell(idx).size(); return true; } @@ -530,7 +530,7 @@ bool MathGridInset::idxRight(idx_type & idx, pos_type & pos) const // leave matrix if on the right hand edge if (col(idx) + 1 == ncols()) return false; - idx++; + ++idx; pos = 0; return true; } @@ -712,13 +712,13 @@ void MathGridInset::mathmlize(MathMLStream & os) const void MathGridInset::write(WriteStream & os) const { for (row_type row = 0; row < nrows(); ++row) { - os << verboseHLine(rowinfo_[row].lines_).c_str(); + os << verboseHLine(rowinfo_[row].lines_); for (col_type col = 0; col < ncols(); ++col) - os << cell(index(row, col)) << eocString(col).c_str(); - os << eolString(row).c_str(); + os << cell(index(row, col)) << eocString(col); + os << eolString(row); } - string s = verboseHLine(rowinfo_[nrows()].lines_); - if (s.size()) - os << "\\\\" << s.c_str(); + string const s = verboseHLine(rowinfo_[nrows()].lines_); + if (!s.empty()) + os << "\\\\" << s; } diff --git a/src/mathed/math_mathmlstream.C b/src/mathed/math_mathmlstream.C index 5579ddc60d..35b2b9ae99 100644 --- a/src/mathed/math_mathmlstream.C +++ b/src/mathed/math_mathmlstream.C @@ -1,5 +1,7 @@ -#include "math_inset.h" +#include + #include "math_mathmlstream.h" +#include "math_inset.h" #include "math_extern.h" #include "debug.h" @@ -209,6 +211,19 @@ WriteStream & WriteStream::operator<<(MathArray const & ar) } +WriteStream & WriteStream::operator<<(string const & s) +{ + os << s; + string::const_iterator cit = s.begin(); + string::const_iterator end = s.end(); + for ( ; cit != end ; ++cit) { + if (*cit == '\n') + ++line_; + } + return *this; +} + + WriteStream & WriteStream::operator<<(char const * s) { os << s; diff --git a/src/mathed/math_mathmlstream.h b/src/mathed/math_mathmlstream.h index 76ec853ac7..e2c97008e3 100644 --- a/src/mathed/math_mathmlstream.h +++ b/src/mathed/math_mathmlstream.h @@ -1,9 +1,12 @@ #ifndef MATH_MATHMLSTREAM_H #define MATH_MATHMLSTREAM_H -#include +#include "LString.h" + #include "support/LOstream.h" +#include + struct MathArray; struct MathInset; struct Buffer; @@ -112,6 +115,8 @@ struct WriteStream { /// WriteStream & operator<<(MathArray const &); /// + WriteStream & operator<<(string const &); + /// WriteStream & operator<<(char const *); /// WriteStream & operator<<(char); -- 2.39.2