Fix the Compare feature. The compl_vector class shouldn't be accessed twice in one statement as it might happen that the vectors are reallocated, such that the references are not correct anymore.

(P.S. Compare this to the fact that you're not supposed to refer to x and ++x in one statement.)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33137 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-01-21 18:58:55 +00:00
parent 3794f7c753
commit 562f1da9c9

View File

@ -525,6 +525,7 @@ void Compare::Impl::furthestDpathKdiagonal(int D, int k,
// Where do we take the step from ?
int const kk = vertical_step ? k + 1 : k - 1;
DocPair p(op[kk], np[kk]);
DocPair const s(os[kk], ns[kk]);
// If D==0 we simulate a vertical step from (0,-1) by doing nothing.
if (D != 0) {
@ -546,8 +547,8 @@ void Compare::Impl::furthestDpathKdiagonal(int D, int k,
ns[k] = p.n;
} else {
// Copy last snake from the previous step
os[k] = os[kk];
ns[k] = ns[kk];
os[k] = s.o;
ns[k] = s.n;
}
//Record new position