]> git.lyx.org Git - features.git/commitdiff
(Johnathan Burchill): change tracker fixes (bug 1827)
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 28 Feb 2005 07:43:12 +0000 (07:43 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 28 Feb 2005 07:43:12 +0000 (07:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9685 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/paragraph.C
src/paragraph_funcs.C

index f829eb127453518e7a313f5b281d4ab317965314..d27d6157e1465bfdb47d68dbd917607948c080e6 100644 (file)
@@ -1,3 +1,12 @@
+2005-02-28  Johnathan Burchill  <jkerrb@users.sourceforge.net>
+
+       * 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  <lasgouttes@lyx.org>
 
        * text2.C (updateCounters, setCounter, expandLabel): move to
index 28caa48fac40dcc04ec76a94f59f14113f6c614d..28471576219e4313967b06f6ce01cfc9e86123f9 100644 (file)
@@ -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;
        }
 
index 9add699a6d5fb377bc6279219324090d983f784d..a5d3a5e777313f0e4c6220e2a320855903ea2cd7 100644 (file)
@@ -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);
+               }
        }
 }