]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_data.C
mathed uglyfication
[lyx.git] / src / mathed / math_data.C
index a63c627710915947f825b63d4e51904cffeba55d..028d213e5ab8207fb3f7d5c0a4df908730dea981 100644 (file)
 #include "math_support.h"
 #include "math_replace.h"
 #include "debug.h"
-#include "support/LAssert.h"
+#include "LColor.h"
+
 #include "frontends/Painter.h"
 
-using namespace lyx::support;
+#include <boost/assert.hpp>
 
 using std::abs;
 using std::endl;
 using std::min;
+using std::ostringstream;
 
 
 MathArray::MathArray()
@@ -47,14 +49,14 @@ void MathArray::substitute(MathMacro const & m)
 
 MathAtom & MathArray::operator[](pos_type pos)
 {
-       Assert(pos < size());
+       BOOST_ASSERT(pos < size());
        return base_type::operator[](pos);
 }
 
 
 MathAtom const & MathArray::operator[](pos_type pos) const
 {
-       Assert(pos < size());
+       BOOST_ASSERT(pos < size());
        return base_type::operator[](pos);
 }
 
@@ -67,7 +69,7 @@ void MathArray::insert(size_type pos, MathAtom const & t)
 
 void MathArray::insert(size_type pos, MathArray const & ar)
 {
-       Assert(pos <= size());
+       BOOST_ASSERT(pos <= size());
        base_type::insert(begin() + pos, ar.begin(), ar.end());
 }
 
@@ -138,7 +140,7 @@ bool MathArray::matchpart(MathArray const & ar, pos_type pos) const
                return false;
        const_iterator it = begin() + pos;
        for (const_iterator jt = ar.begin(); jt != ar.end(); ++jt, ++it)
-               if (!(*jt)->match(*it))
+               if (asString(*it) != asString(*jt))
                        return false;
        return true;
 }
@@ -165,9 +167,9 @@ void MathArray::replace(ReplaceData & rep)
 
 bool MathArray::find1(MathArray const & ar, size_type pos) const
 {
-       //lyxerr << "finding '" << ar << "' in '" << *this << "'" << endl;
+       lyxerr << "finding '" << ar << "' in '" << *this << "'" << endl;
        for (size_type i = 0, n = ar.size(); i < n; ++i)
-               if (!operator[](pos + i)->match(ar[i]))
+               if (asString(operator[](pos + i)) != asString(ar[i]))
                        return false;
        return true;
 }
@@ -401,6 +403,7 @@ void MathArray::notifyCursorLeaves()
 {
        // do not recurse!
 
+/*
        // remove base-only "scripts"
        for (pos_type i = 0; i + 1 < size(); ++i) {
                MathScriptInset * p = operator[](i).nucleus()->asScriptInset();
@@ -422,5 +425,5 @@ void MathArray::notifyCursorLeaves()
                        mathcursor->adjust(i, -1);
                }
        }
-
+*/
 }