Fix #1043 (Conversion Error: LIT to LRF)

This commit is contained in:
Kovid Goyal 2008-09-25 10:19:45 -07:00
parent 42a3b5f3b7
commit ce468602a0
3 changed files with 7 additions and 5 deletions

View File

@ -778,11 +778,11 @@ class HTMLConverter(object, LoggingInterface):
@param css: A dict
'''
src = tag.string if hasattr(tag, 'string') else tag
if len(src) > 32767:
if len(src) > 32760:
pos = 0
while pos < len(src):
self.add_text(src[pos:pos+32767], css, pseudo_css, force_span_use)
pos += 32767
self.add_text(src[pos:pos+32760], css, pseudo_css, force_span_use)
pos += 32760
return
src = src.replace('\r\n', '\n').replace('\r', '\n')

View File

@ -118,7 +118,6 @@ def writeLineWidth(f, width):
def writeUnicode(f, string, encoding):
if isinstance(string, str):
string = string.decode(encoding)
string = string.encode("utf-16-le")
length = len(string)
if length > 65535:

View File

@ -258,7 +258,10 @@ class BooksModel(QAbstractTableModel):
for i in range(1, k):
ids.extend([idx-i, idx+i])
ids = ids + [i for i in range(l, r, 1) if i not in ids]
try:
ids = [self.db.id(i) for i in ids]
except IndexError:
return
self.cover_cache.set_cache(ids)
def current_changed(self, current, previous, emit_signal=True):