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

List:       kmail-devel
Subject:    [Bug 66172] spell suggestion replaces wrong word
From:       Ingo "Klöcker" <kloecker () kde ! org>
Date:       2003-10-31 0:48:02
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
     
http://bugs.kde.org/show_bug.cgi?id=66172     
kloecker@kde.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From kloecker@kde.org  2003-10-31 01:48 -------
Subject: kdepim/kmail

CVS commit by kloecker: 

Fix problems with replacing misspelled words. Based on patch by Daniel Naber.
CCMAIL: 66172-fixed@bugs.kde.org
CCMAIL: 66174-fixed@bugs.kde.org


  M +6 -10     kmcomposewin.cpp   1.759


--- kdepim/kmail/kmcomposewin.cpp  #1.758:1.759
@@ -5886,14 +5886,10 @@ bool KMEdit::eventFilter(QObject*o, QEve
           int parIdx = 1, txtIdx = 1;
           getCursorPosition(&parIdx, &txtIdx);
-
-          //Put in our replacement
-          QString txtContents = text();
-          QString newContents = txtContents.left(firstSpace) + mReplacements[word][id] +
-                                txtContents.right( txtContents.length() - lastSpace );
-          setText( newContents );
-
-          //Restore the cursor position
-          if( txtIdx > lastSpace )
-            txtIdx += newContents.length() - txtContents.length();
+          setSelection(para, firstSpace, para, lastSpace);
+          insert(mReplacements[word][id]);
+          // Restore the cursor position; if the cursor was behind the
+          // misspelled word then adjust the cursor position
+          if ( para == parIdx && txtIdx >= lastSpace )
+            txtIdx += mReplacements[word][id].length() - word.length();
           setCursorPosition(parIdx, txtIdx);
         }
_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail
[prev in list] [next in list] [prev in thread] [next in thread] 

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