Fix #4606 (Viewer crash on MOBI files created from PDB)

This commit is contained in:
Kovid Goyal 2010-01-20 23:16:30 -07:00
parent ae2b434b35
commit 1e12cfeb74
2 changed files with 8 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class GlobeAndMail(BasicNewsRecipe):
'gallery-controls', 'video', 'galleryLoading','deck','header', 'gallery-controls', 'video', 'galleryLoading','deck','header',
'toolsBottom'] }, 'toolsBottom'] },
{'class':['credit','inline-img-caption','tab-pointer'] }, {'class':['credit','inline-img-caption','tab-pointer'] },
dict(name='div', attrs={'id':'lead-photo'}), dict(name='div', attrs={'id':['lead-photo', 'most-popular-story']}),
dict(name='div', attrs={'class':'right'}), dict(name='div', attrs={'class':'right'}),
dict(name='div', attrs={'id':'footer'}), dict(name='div', attrs={'id':'footer'}),
dict(name='div', attrs={'id':'beta-msg'}), dict(name='div', attrs={'id':'beta-msg'}),

View File

@ -350,7 +350,13 @@ class Document(QWebPage):
return self.mainFrame().contentsSize().width() # offsetWidth gives inaccurate results return self.mainFrame().contentsSize().width() # offsetWidth gives inaccurate results
def set_bottom_padding(self, amount): def set_bottom_padding(self, amount):
self.javascript('$("body").css("padding-bottom", "%dpx")' % amount) padding = '%dpx'%amount
try:
old_padding = unicode(self.javascript('$("body").css("padding-bottom")').toString())
except:
old_padding = ''
if old_padding != padding:
self.javascript('$("body").css("padding-bottom", "%s")' % padding)
class EntityDeclarationProcessor(object): class EntityDeclarationProcessor(object):