previewdoc: add correct handling of width/height

This commit is contained in:
Frédéric Péters 2011-10-11 10:35:21 -04:00
parent 93c005765e
commit 90bf14cb6a
1 changed files with 8 additions and 0 deletions

View File

@ -398,3 +398,11 @@ class DocHistoLines(Field):
class PreviewDoc(Field):
implements(IPreviewDoc, IFromUnicode)
def __init__(self, **kw):
for attr in ('height', 'width'):
if kw.get(attr):
setattr(self, attr, kw.get('attr'))
if attr in kw:
del kw[attr]
super(PreviewDoc, self).__init__(**kw)