From d7d9af5fa02212b225af7bf7f4c4cf965f5c4a2d Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Sat, 25 Nov 2006 00:31:44 +0000 Subject: [PATCH] * src/text.C: fix change tracking for backspace git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16035 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/text.C | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/text.C b/src/text.C index f118faad8f..b5a80cc3b0 100644 --- a/src/text.C +++ b/src/text.C @@ -1747,21 +1747,13 @@ bool LyXText::backspace(LCursor & cur) if (cur.pit() == 0) return dissolveInset(cur); - if (cur.buffer().params().trackChanges) { - // FIXME: Change tracking (MG) - // Previous paragraph, mark "carriage return" as - // deleted: - Paragraph & par = pars_[cur.pit() - 1]; - // Take care of a just inserted para break: - // FIXME: change tracking (MG) - if (!par.isInserted(par.size())) { - // FIXME: change tracking (MG) - par.setChange(par.size(), Change(Change::DELETED)); - setCursorIntern(cur, cur.pit() - 1, par.size()); - return true; - } - } + Paragraph & prev_par = pars_[cur.pit() - 1]; + if (!prev_par.isMergedOnEndOfParDeletion(cur.buffer().params().trackChanges)) { + prev_par.setChange(prev_par.size(), Change(Change::DELETED)); + setCursorIntern(cur, cur.pit() - 1, prev_par.size()); + return true; + } // The cursor is at the beginning of a paragraph, so // the backspace will collapse two paragraphs into one. needsUpdate = backspacePos0(cur); @@ -1776,7 +1768,6 @@ bool LyXText::backspace(LCursor & cur) // without the dreaded mechanism. (JMarc) setCursorIntern(cur, cur.pit(), cur.pos() - 1, false, cur.boundary()); - // FIXME: change tracking (MG) cur.paragraph().eraseChar(cur.pos(), cur.buffer().params().trackChanges); }