mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix #941134 (LibreOffice 3.5 odt to conversion mobi problem)
This commit is contained in:
parent
eaf96d2807
commit
35ddd44a89
@ -937,7 +937,20 @@ ol, ul { padding-left: 2em; }
|
|||||||
"""
|
"""
|
||||||
if self.currentstyle is None: # Added by Kovid
|
if self.currentstyle is None: # Added by Kovid
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Added by Kovid
|
||||||
|
names = {x[1]:x for x in attrs.iterkeys()}
|
||||||
|
ignore_keys = set()
|
||||||
|
if ('margin' in names and 'margin-top' in names and 'margin-left' in
|
||||||
|
names and 'margin-right' in names and 'margin-bottom' in
|
||||||
|
names):
|
||||||
|
# These come from XML and we cannot preserve XML attribute order so
|
||||||
|
# we assume that margin is to be overriden
|
||||||
|
# See https://bugs.launchpad.net/calibre/+bug/941134
|
||||||
|
ignore_keys.add(names['margin'])
|
||||||
|
|
||||||
for key,attr in attrs.items():
|
for key,attr in attrs.items():
|
||||||
|
if key not in ignore_keys:
|
||||||
self.styledict[self.currentstyle][key] = attr
|
self.styledict[self.currentstyle][key] = attr
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user