From: Jürgen Spitzmüller Date: Mon, 28 Feb 2005 07:43:12 +0000 (+0000) Subject: (Johnathan Burchill): change tracker fixes (bug 1827) X-Git-Tag: 1.6.10~14494 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2849fbae2a5c94175dcb918952ffbf87fe435199;p=lyx.git (Johnathan Burchill): change tracker fixes (bug 1827) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9685 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index f829eb1274..d27d6157e1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2005-02-28 Johnathan Burchill + + * paragraph.C: fix for confused change tracker when pasting + text that begins with a lineseparator. [bug 1827] + (setChange(0, Change::INSERTED);) + + * paragraph_funcs.C: fix for lost changes on triple-paste + in change tracking mode [bug 1827] (par.setChange()). + 2005-02-24 Jean-Marc Lasgouttes * text2.C (updateCounters, setCounter, expandLabel): move to diff --git a/src/paragraph.C b/src/paragraph.C index 28caa48fac..2847157621 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -578,7 +578,9 @@ int Paragraph::stripLeadingSpaces() int i = 0; while (!empty() && (isNewline(0) || isLineSeparator(0))) { - pimpl_->eraseIntern(0); + // Set Change::Type to Change::INSERTED to quietly remove it + setChange(0, Change::INSERTED); + erase(0); ++i; } diff --git a/src/paragraph_funcs.C b/src/paragraph_funcs.C index 9add699a6d..a5d3a5e777 100644 --- a/src/paragraph_funcs.C +++ b/src/paragraph_funcs.C @@ -214,9 +214,13 @@ void breakParagraphConservative(BufferParams const & bparams, if (moveItem(par, tmp, bparams, i, j - pos, change)) ++j; } - - for (pos_type k = pos_end; k >= pos; --k) - par.eraseIntern(k); + // If tracking changes, set all the text that is to be + // erased to Type::INSERTED. + for (pos_type k = pos_end; k >= pos; --k) { + if (bparams.tracking_changes) + par.setChange(k, Change::INSERTED); + par.erase(k); + } } }