]> git.lyx.org Git - lyx.git/commitdiff
test add a string operator and comment out a couple of unused args
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 2 Dec 2001 17:03:46 +0000 (17:03 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 2 Dec 2001 17:03:46 +0000 (17:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3134 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_gridinset.C
src/mathed/math_mathmlstream.C
src/mathed/math_mathmlstream.h

index 4cdb775baea6e541aaea340e1ed3b8a3a02c1313..51668da8f8f40498ed671be1f02bb02e9c6efe82 100644 (file)
@@ -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;
 }
 
index 5579ddc60d9e7a49af25305225b38dbed64dee3f..35b2b9ae99a70e74f2463246b12fc0cbc743b97f 100644 (file)
@@ -1,5 +1,7 @@
-#include "math_inset.h"
+#include <config.h>
+
 #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;
index 76ec853ac716702db01a110e9a3f4b1fe491213e..e2c97008e316dcd4cbe6cf24f88a3b95d3cb34ea 100644 (file)
@@ -1,9 +1,12 @@
 #ifndef MATH_MATHMLSTREAM_H
 #define MATH_MATHMLSTREAM_H
 
-#include <iosfwd>
+#include "LString.h"
+
 #include "support/LOstream.h"
 
+#include <iosfwd>
+
 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);