From f9873ab3cad9bb5121bbb0a4aa3818ded0dc3fb7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Mar 2017 09:05:52 +0530 Subject: [PATCH] Ensure word list is unique --- 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 37dc5e3c6b..c074695999 100644 --- a/src/calibre/gui2/tweak_book/spell.py +++ b/src/calibre/gui2/tweak_book/spell.py @@ -1094,7 +1094,11 @@ class SpellCheck(Dialog): suggestions = dictionaries.suggestions(*w) self.suggested_list.clear() word_suggested = False + seen = set() for i, s in enumerate(chain(suggestions, (current_word,))): + if s in seen: + continue + seen.add(s) item = QListWidgetItem(s, self.suggested_list) if i == 0: self.suggested_list.setCurrentItem(item)