[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bcalligra/words-change=5Ftracking-ganeshp=5D_libs/ko?=
From:       Ganesh Paramasivam <ganesh () crystalfab ! com>
Date:       2011-04-10 12:07:19
Message-ID: 20110410120719.4E7F0A609B () git ! kde ! org
[Download RAW message or body]

Git commit a624a86b3c5a0f7932b262705009927bb08c3231 by Ganesh Paramasivam.
Committed on 10/04/2011 at 14:06.
Pushed by ganeshp into branch 'words-change_tracking-ganeshp'.

Fixing the problem of application hang-up on a insertion after a disable of Record \
Changes

M  +5    -11   libs/kotext/KoTextEditor.cpp     

http://commits.kde.org/calligra/a624a86b3c5a0f7932b262705009927bb08c3231

diff --git a/libs/kotext/KoTextEditor.cpp b/libs/kotext/KoTextEditor.cpp
index d49711f..3bc342f 100644
--- a/libs/kotext/KoTextEditor.cpp
+++ b/libs/kotext/KoTextEditor.cpp
@@ -364,17 +364,11 @@ void KoTextEditor::registerTrackedChange(QTextCursor \
&selection, KoGenChange::Ty  QTextCursor cursor(block);
                 cursor.setPosition(fragment.position());
                 QTextCharFormat fm = cursor.charFormat();
-                if (fm.hasProperty(KoCharacterStyle::ChangeTrackerId)) {
-                    fm.clearProperty(KoCharacterStyle::ChangeTrackerId);
-                    int to = qMin(end, fragment.position() + fragment.length());
-                    cursor.setPosition(to, QTextCursor::KeepAnchor);
-                    cursor.setCharFormat(fm);
-
-                    //Changing the format invalidates the iterator. So, reset the \
                iterator and start from the beginning.
-                    iter = block.begin();
-                    continue;
-                }
-                iter++;
+                fm.clearProperty(KoCharacterStyle::ChangeTrackerId);
+                int to = qMin(end, fragment.position() + fragment.length());
+                cursor.setPosition(to, QTextCursor::KeepAnchor);
+                cursor.setCharFormat(fm);
+                ++iter;
             }
             block = block.next();
         }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic