On Tue, May 23, 2006 at 04:45:39PM +0200, Juergen Spitzmueller wrote:
> I came across a rather annoying change tracking bug today:
> 
> 1. New document
> 2. insert "word1 word2"
> 3. turn on change tracking
> 4. insert "word0 " before "word1"
> 5. place cursor in front of "word0" and press DEL
> => the char "w" in "word1" is marked INSERTED. In fact, all change tracking
> marks in the given paragraph are shifted on char rightwards. Same happens
> with backspace.
> 
> I filed this as bug 2613 (it looks familiar to bug 1827, but is not
> identical (bug 1827 remains fixed)).
> 
> Michael, could you look after that during your ct rework of 1.5?
> 
> However, I think we should also do something about 1.4. This bug muddles the
> whole change tracking information of a paragraph. I really lost some data
> before I became aware of it.
> 
> Jürgen

Mea culpa.

My previous fix for the numberless crashing bug reported by Jean-Marc
was a little too simple ;-/ Attached a better one.

I propose to only apply this to 1.4.x and leave 1.5 to Michael.

- Martin


Index: paragraph_pimpl.C
===================================================================
--- paragraph_pimpl.C   (revision 13885)
+++ paragraph_pimpl.C   (working copy)
@@ -371,10 +371,11 @@
 
        if (tracking()) {
                Change::Type changetype(changes_->lookup(pos).type);
+               if (pos < size())
+                       changes_->record(Change(Change::DELETED), pos);
 
                // only allow the actual removal if it was /new/ text
                if (changetype != Change::INSERTED) {
-                       changes_->record(Change(Change::DELETED), pos);
                        if (pos < size() && owner_->isInset(pos))
                                owner_->getInset(pos)->markErased(true);
                        return false;

Attachment: pgpu3VgXaZg9y.pgp
Description: PGP signature

Reply via email to