DOCX: Fix partially broken style cascading

Style cascading for font sizes was not working fully because of
premature evaluation of run css while checking the borders.
This commit is contained in:
Kovid Goyal 2013-06-12 11:23:45 +05:30
parent a447b0818d
commit 0cc7a43ded

View File

@ -235,16 +235,5 @@ class RunStyle(object):
return self._css return self._css
def same_border(self, other): def same_border(self, other):
for x in (self, other): return self.get_border_css({}) == other.get_border_css({})
has_border = False
for y in ('color', 'style', 'width'):
if ('border-%s' % y) in x.css:
has_border = True
break
if not has_border:
return False
s = tuple(self.css.get('border-%s' % y, None) for y in ('color', 'style', 'width'))
o = tuple(other.css.get('border-%s' % y, None) for y in ('color', 'style', 'width'))
return s == o