]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathData.C
cursor is no more damaging the background. L-shaped cursor is broken right now....
[lyx.git] / src / mathed / MathData.C
index f124a5d04319906c92717826d7d12daa50f41aec..41cb2458b47b0f41ac221c3ddd3b7bb37c0a74da 100644 (file)
@@ -15,7 +15,7 @@
 #include "InsetMathScript.h"
 #include "InsetMathMacro.h"
 #include "MathMacroTable.h"
-#include "MathMLStream.h"
+#include "MathStream.h"
 #include "MathSupport.h"
 #include "MathReplace.h"
 
@@ -29,6 +29,9 @@
 
 #include <boost/assert.hpp>
 
+
+namespace lyx {
+
 using std::abs;
 using std::endl;
 using std::min;
@@ -37,10 +40,6 @@ using std::string;
 using std::vector;
 
 
-MathArray::MathArray()
-{}
-
-
 MathArray::MathArray(const_iterator from, const_iterator to)
        : base_type(from, to)
 {}
@@ -106,17 +105,21 @@ void MathArray::erase(size_type pos1, size_type pos2)
 
 void MathArray::dump2() const
 {
-       NormalStream ns(lyxerr);
+       odocstringstream os;
+       NormalStream ns(os);
        for (const_iterator it = begin(); it != end(); ++it)
                ns << *it << ' ';
+       lyxerr << to_utf8(os.str());
 }
 
 
 void MathArray::dump() const
 {
-       NormalStream ns(lyxerr);
+       odocstringstream os;
+       NormalStream ns(os);
        for (const_iterator it = begin(); it != end(); ++it)
                ns << '<' << *it << '>';
+       lyxerr << to_utf8(os.str());
 }
 
 
@@ -218,7 +221,7 @@ void MathArray::metrics(MetricsInfo & mi, Dimension & dim) const
 namespace {
 
 bool isInside(DocIterator const & it, MathArray const & ar,
-       lyx::pos_type p1, lyx::pos_type p2)
+       pos_type p1, pos_type p2)
 {
        for (size_t i = 0; i != it.depth(); ++i) {
                CursorSlice const & sl = it[i];
@@ -333,21 +336,8 @@ void MathArray::drawT(TextPainter & pain, int x, int y) const
 {
        //lyxerr << "x: " << x << " y: " << y << ' ' << pain.workAreaHeight() << endl;
 
-       // FIXME: Abdel 13/10/2006
-       // The setXV() call below is commented out for now because
-       // we don't have access to a BufferView at this level.
-       // In any case, this drawT() method is never used, this is dead code.
-       //
-       /* Georg explanation of current situation:
-       AFAIK the text painter was used to export math formulas as ASCII art.
-       Therefore the setXY() call makes sense. Imagine that the text painter is
-       like a real painter, but operating on a very coarse grid of character cells
-       where each cell can be filled with an ASCII character.
-       I don't know why it is currently disabled. I do know that we have a bugzilla
-       request for reenabling it. I believe only Andre can tell whether that is
-       doable or whether the whole drawT machinery should be removed.  
-       */
-       //setXY(bv, x, y);
+       // FIXME: Abdel 16/10/2006
+       // This drawT() method is never used, this is dead code.
 
        for (const_iterator it = begin(), et = end(); it != et; ++it) {
                (*it)->drawT(pain, x, y);
@@ -457,3 +447,23 @@ int MathArray::yo(BufferView & bv) const
 {
        return bv.coordCache().getArrays().y(this);
 }
+
+
+std::ostream & operator<<(std::ostream & os, MathArray const & ar)
+{
+       odocstringstream oss;
+       NormalStream ns(oss);
+       ns << ar;
+       return os << to_utf8(oss.str());
+}
+
+
+odocstream & operator<<(odocstream & os, MathArray const & ar)
+{
+       NormalStream ns(os);
+       ns << ar;
+       return os;
+}
+
+
+} // namespace lyx