]> git.lyx.org Git - features.git/commitdiff
change tracking:
authorMichael Schmitt <michael.schmitt@teststep.org>
Thu, 26 Oct 2006 21:06:55 +0000 (21:06 +0000)
committerMichael Schmitt <michael.schmitt@teststep.org>
Thu, 26 Oct 2006 21:06:55 +0000 (21:06 +0000)
* src/paragraph_pimpl.C: in method erase(),
set the character to DELETED if
a) it was previously unchanged or
b) it was inserted by a co-author

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15573 a592a061-630c-0410-9148-cb99ea01b6c8

src/paragraph_pimpl.C

index 63f03be183a12bb863c6e0ed673b8f5fa6651ad0..7e311e5bd69b418112ffd5b7332a2a98e0dd0ab8 100644 (file)
@@ -273,14 +273,19 @@ bool Paragraph::Pimpl::eraseChar(pos_type pos, bool trackChanges)
        BOOST_ASSERT(pos >= 0 && pos <= size());
 
        if (trackChanges) {
-               Change::Type changetype(changes_.lookup(pos).type);
+               Change change = changes_.lookup(pos);
 
-               if (changetype == Change::UNCHANGED) {
+               // set the character to DELETED if 
+               //  a) it was previously unchanged or
+               //  b) it was inserted by a co-author
+
+               if (change.type == Change::UNCHANGED ||
+                   (change.type == Change::INSERTED && change.author != 0)) {
                        setChange(pos, Change(Change::DELETED));
                        return false;
                }
 
-               if (changetype == Change::DELETED)
+               if (change.type == Change::DELETED)
                        return false;
        }