From 6ee7e7af46dedcc7a54c944ae1c4080f89b317fc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 13 May 2014 21:27:38 +0530 Subject: [PATCH] ... --- src/calibre/gui2/tweak_book/editor/text.py | 2 +- src/calibre/gui2/tweak_book/editor/widget.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index 6b120691d3..dd6a4bcbf1 100644 --- a/src/calibre/gui2/tweak_book/editor/text.py +++ b/src/calibre/gui2/tweak_book/editor/text.py @@ -430,7 +430,7 @@ class TextEdit(PlainTextEdit): block = c.block() while block.isValid(): for r in block.layout().additionalFormats(): - if r.format.property(SPELL_PROPERTY).toBool(): + if r.format.property(SPELL_PROPERTY): if not from_cursor or block.position() + r.start + r.length > c.position(): c.setPosition(block.position() + r.start) c.setPosition(c.position() + r.length, c.KeepAnchor) diff --git a/src/calibre/gui2/tweak_book/editor/widget.py b/src/calibre/gui2/tweak_book/editor/widget.py index b79b02b908..6880297eb7 100644 --- a/src/calibre/gui2/tweak_book/editor/widget.py +++ b/src/calibre/gui2/tweak_book/editor/widget.py @@ -426,11 +426,11 @@ class Editor(QMainWindow): c = self.editor.cursorForPosition(pos) origc = QTextCursor(c) r = origr = self.editor.syntax_range_for_cursor(c) - if (r is None or not r.format.property(SPELL_PROPERTY).toBool()) and c.positionInBlock() > 0: + if (r is None or not r.format.property(SPELL_PROPERTY)) and c.positionInBlock() > 0: c.setPosition(c.position() - 1) r = self.editor.syntax_range_for_cursor(c) - if r is not None and r.format.property(SPELL_PROPERTY).toBool(): + if r is not None and r.format.property(SPELL_PROPERTY): word = self.editor.text_for_range(c.block(), r) locale = self.editor.spellcheck_locale_for_cursor(c) orig_pos = c.position()