mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
a447b0818d
commit
0cc7a43ded
@ -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
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user