Compare:\n- Fix the doubly added first snake. \n- Fix the behaviour when comparing two the same files.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33184 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-01-24 00:55:08 +00:00
parent a45d8502e9
commit e3c9fa3d0d

View File

@ -691,7 +691,9 @@ bool Compare::Impl::diff(Buffer const * new_buf, Buffer const * old_buf,
processSnake(snake);
// Start the recursive algorithm
diff_i(rp);
DocRangePair rp_new(from, rp.to());
if (!rp_new.o.empty() || !rp_new.n.empty())
diff_i(rp_new);
for (pit_type p = 0; p < (pit_type)dest_pars_->size(); ++p) {
(*dest_pars_)[p].setBuffer(const_cast<Buffer &>(*dest_buf));