← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~mzanetti/reminders-app/fix-autocorrection-formatting into lp:reminders-app

 

Michael Zanetti has proposed merging lp:~mzanetti/reminders-app/fix-autocorrection-formatting into lp:reminders-app with lp:~mzanetti/reminders-app/confirm-autocorrection-on-save as a prerequisite.

Commit message:
fix formatting with autocorrection enabled


Requested reviews:
  Ubuntu Reminders app developers (reminders-app-dev)

For more details, see:
https://code.launchpad.net/~mzanetti/reminders-app/fix-autocorrection-formatting/+merge/255736
-- 
Your team Ubuntu Reminders app developers is requested to review the proposed merge of lp:~mzanetti/reminders-app/fix-autocorrection-formatting into lp:reminders-app.
=== modified file 'src/app/formattinghelper.cpp'
--- src/app/formattinghelper.cpp	2015-03-17 21:57:54 +0000
+++ src/app/formattinghelper.cpp	2015-04-09 18:35:36 +0000
@@ -72,8 +72,8 @@
 
 void FormattingHelper::setCursorPosition(int position)
 {
-    if (m_textCursor.position() == m_formatPosition + 1) {
-        m_textCursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor);
+    if (m_formatPosition >= 0 && m_textCursor.position() == position) {
+        m_textCursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, position - m_formatPosition);
         m_textCursor.setCharFormat(m_nextFormat);
     }
     m_textCursor.setPosition(position);


Follow ups