From 796df81638086869b79385b11040b3e0182e68d0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 16 Feb 2017 11:18:15 +0530 Subject: [PATCH] Edit Book: Spell Check: If there are no suggestions fill the suggested word box witht he original word. Fixes #1664284 [[enhancement] show original word in "change selected word to" when there are no spelling suggestions in the "check spelling" window](https://bugs.launchpad.net/calibre/+bug/1664284) --- src/calibre/gui2/tweak_book/spell.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/tweak_book/spell.py b/src/calibre/gui2/tweak_book/spell.py index 0abc632801..dfa6610c27 100644 --- a/src/calibre/gui2/tweak_book/spell.py +++ b/src/calibre/gui2/tweak_book/spell.py @@ -1092,11 +1092,15 @@ class SpellCheck(Dialog): in_user_dictionary = dictionaries.word_in_user_dictionary(*w) suggestions = dictionaries.suggestions(*w) self.suggested_list.clear() + word_suggested = False for i, s in enumerate(suggestions): item = QListWidgetItem(s, self.suggested_list) if i == 0: self.suggested_list.setCurrentItem(item) self.suggested_word.setText(s) + word_suggested = True + if not word_suggested: + self.suggested_word.setText(current_word) prefix = b.unign_text if ignored else b.ign_text b.setText(prefix + ' ' + current_word)