This commit is contained in:
Kovid Goyal 2014-06-24 19:24:18 +05:30
parent bf24620e5f
commit 87d2e742ad
3 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import,
__license__ = 'GPL v3' __license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
from PyQt4.Qt import QTextCharFormat from PyQt5.Qt import QTextCharFormat
from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES
from calibre.ebooks.oeb.polish.container import guess_type from calibre.ebooks.oeb.polish.container import guess_type

View File

@ -567,7 +567,7 @@ class XMLHighlighter(HTMLHighlighter):
def profile(): def profile():
import sys import sys
from PyQt4.Qt import QTextDocument from PyQt5.Qt import QTextDocument
from calibre.gui2 import Application from calibre.gui2 import Application
from calibre.gui2.tweak_book import set_book_locale from calibre.gui2.tweak_book import set_book_locale
from calibre.gui2.tweak_book.editor.themes import get_theme from calibre.gui2.tweak_book.editor.themes import get_theme

View File

@ -582,8 +582,8 @@ class TextEdit(PlainTextEdit):
formats = self.highlighter.parse_single_block(c.block())[0] formats = self.highlighter.parse_single_block(c.block())[0]
pos = c.positionInBlock() pos = c.positionInBlock()
for r in formats: for r in formats:
if r.start <= pos < r.start + r.length and r.format.property(SPELL_PROPERTY).toBool(): if r.start <= pos < r.start + r.length and r.format.property(SPELL_PROPERTY):
return r.format.property(SPELL_LOCALE_PROPERTY).toPyObject() return r.format.property(SPELL_LOCALE_PROPERTY)
def recheck_word(self, word, locale): def recheck_word(self, word, locale):
c = self.textCursor() c = self.textCursor()