]> git.lyx.org Git - features.git/blobdiff - src/mathed/math_data.C
simplified search in mathed
[features.git] / src / mathed / math_data.C
index a7f606eb6314a21df53fc7ae3b5932d9b58120ec..35c727e263d229ba291c87157b25a8013d5b1f60 100644 (file)
 #include "math_replace.h"
 #include "debug.h"
 #include "LColor.h"
+
 #include "frontends/Painter.h"
+
 #include <boost/assert.hpp>
 
 using std::abs;
 using std::endl;
 using std::min;
+using std::ostringstream;
 
 
 MathArray::MathArray()
@@ -137,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;
 }
@@ -164,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;
 }