Git commit 08b0eb4f8bd1331099718260a1ff99d3c4a4fb29 by Pierre Stirnweiss. Committed on 06/01/2013 at 09:55. Pushed by pstirnweiss into branch 'calligra/2.6'. Fix wrong style applied on backspace When using backspace, we keep the char format of the deleted char. This should not apply when deleting across the newline boundary. BUG: 312584 REVIEW: 108199 M +4 -1 libs/kotext/commands/DeleteCommand.cpp http://commits.kde.org/calligra/08b0eb4f8bd1331099718260a1ff99d3c4a4fb29 diff --git a/libs/kotext/commands/DeleteCommand.cpp b/libs/kotext/commands/= DeleteCommand.cpp index 622062a..06c1528 100644 --- a/libs/kotext/commands/DeleteCommand.cpp +++ b/libs/kotext/commands/DeleteCommand.cpp @@ -138,6 +138,7 @@ void DeleteCommand::doDelete() Q_ASSERT(textEditor); QTextCursor *caret =3D textEditor->cursor(); QTextCharFormat charFormat =3D caret->charFormat(); + bool caretAtBeginOfBlock =3D (caret->position() =3D=3D caret->block().= position()); = if (!textEditor->hasSelection()) { if (m_mode =3D=3D PreviousChar) { @@ -176,7 +177,9 @@ void DeleteCommand::doDelete() = caret->deleteChar(); = - caret->setCharFormat(charFormat); + if (m_mode !=3D PreviousChar || !caretAtBeginOfBlock) { + caret->setCharFormat(charFormat); + } } = void DeleteCommand::deleteTextAnchor(KoInlineObject *object)