quick fix: hide top spacing in text fields in reports

This commit is contained in:
Helmut Merz 2012-04-09 13:45:02 +02:00
parent ff82b2bc49
commit a67bb15dd0

View file

@ -39,7 +39,17 @@ class TextField(Field):
def getDisplayValue(self, row):
value = self.getValue(row)
return row.parent.context.view.renderText(value, self.format)
text = row.parent.context.view.renderText(value, self.format)
text = self.removeTopSpacing(text)
return text
def removeTopSpacing(self, text):
styleInfo = u' style="margin-top: 0"'
for tag in (u'<p', u'<ol', u'<ul'):
if text.startswith(tag):
text = tag + styleInfo + text[len(tag):]
break
return text
class DecimalField(Field):