]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_data.C
updates to latexfeatures stuff; allow empty \document_path
[lyx.git] / src / mathed / math_data.C
index 69b9bfe69c64bce104e175d4699851093fa9a6b7..faf37c415e919cd56e8f3d8decbc846df40ebe59 100644 (file)
@@ -211,10 +211,17 @@ MathArray::iterator MathArray::end()
 
 bool MathArray::match(MathArray const & ar) const
 {
-       if (size() != ar.size())
+       return size() == ar.size() && matchpart(ar, 0);
+}
+
+
+bool MathArray::matchpart(MathArray const & ar, pos_type pos) const
+{
+       if (size() < ar.size() + pos)
                return false;
-       for (const_iterator it = begin(), jt = ar.begin(); it != end(); ++it, ++jt)
-               if (!it->nucleus()->match(jt->nucleus()))
+       const_iterator it = begin() + pos; 
+       for (const_iterator jt = ar.begin(); jt != ar.end(); ++jt, ++it)
+               if (!jt->nucleus()->match(it->nucleus()))
                        return false;
        return true;
 }