Git commit 7e34c45ce0f733008b489c83b15f9f47a0c39af8 by Ganesh Paramasivam. Committed on 13/04/2011 at 12:55. Pushed by ganeshp into branch 'master'. Fixing a bug that resulted in the crash of words when the char-format of a fragment of text is changed M +11 -6 libs/kotext/KoTextEditor.cpp http://commits.kde.org/calligra/7e34c45ce0f733008b489c83b15f9f47a0c39af8 diff --git a/libs/kotext/KoTextEditor.cpp b/libs/kotext/KoTextEditor.cpp index 3bc342f..d3f466d 100644 --- a/libs/kotext/KoTextEditor.cpp +++ b/libs/kotext/KoTextEditor.cpp @@ -363,12 +363,17 @@ void KoTextEditor::registerTrackedChange(QTextCursor &selection, KoGenChange::Ty QTextCursor cursor(block); cursor.setPosition(fragment.position()); - QTextCharFormat fm = cursor.charFormat(); - fm.clearProperty(KoCharacterStyle::ChangeTrackerId); - int to = qMin(end, fragment.position() + fragment.length()); - cursor.setPosition(to, QTextCursor::KeepAnchor); - cursor.setCharFormat(fm); - ++iter; + QTextCharFormat fm = fragment.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); + iter = block.begin(); + } else { + iter++; + } } block = block.next(); }