summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-08-28 08:42:46 (GMT)
committerMontel Laurent <montel@kde.org>2016-08-28 08:42:46 (GMT)
commit5daaca99fc12cecf4c7976577817bbc8b4b395f0 (patch)
treed3789bb400a592fd99ba1217d114aeff2f3113b4
parent67a78e2c01b435027ec7b36dace33e6024b1acfa (diff)
Comment for the moment selected text method
-rw-r--r--messagecomposer/src/composer-ng/richtextcomposerng.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/messagecomposer/src/composer-ng/richtextcomposerng.cpp b/messagecomposer/src/composer-ng/richtextcomposerng.cpp
index bc7a217..0169e46 100644
--- a/messagecomposer/src/composer-ng/richtextcomposerng.cpp
+++ b/messagecomposer/src/composer-ng/richtextcomposerng.cpp
@@ -376,25 +376,25 @@ void RichTextComposerNg::forceAutoCorrection(bool selectedText)
const int initialPosition = textCursor().position();
QTextCursor cur = textCursor();
cur.beginEditBlock();
- if (selectedText && cur.hasSelection()) {
+ if (/*selectedText && cur.hasSelection()*/0) {
//TODO
cur.movePosition(QTextCursor::Start);
} else {
cur.movePosition(QTextCursor::Start);
- }
- while(!cur.atEnd()) {
- if(isLineQuoted(cur.block().text())) {
- cur.movePosition(QTextCursor::NextBlock);
- } else {
- cur.movePosition(QTextCursor::NextWord);
+ while(!cur.atEnd()) {
+ if(isLineQuoted(cur.block().text())) {
+ cur.movePosition(QTextCursor::NextBlock);
+ } else {
+ cur.movePosition(QTextCursor::NextWord);
+ }
+ int cursorPosition = cur.position();
+ d->autoCorrection->autocorrect(richText, *document(), cursorPosition);
+ }
+ cur.endEditBlock();
+ if (cur.position() != initialPosition) {
+ cur.setPosition(initialPosition);
+ setTextCursor(cur);
}
- int cursorPosition = cur.position();
- d->autoCorrection->autocorrect(richText, *document(), cursorPosition);
- }
- cur.endEditBlock();
- if (cur.position() != initialPosition) {
- cur.setPosition(initialPosition);
- setTextCursor(cur);
}
}
}