DOCX Input: Dont ignore images that are present as fallbacks for a word drawing object. Fixes #2013972 [Pictures disappearing](https://bugs.launchpad.net/calibre/+bug/2013972)

This commit is contained in:
Kovid Goyal 2023-04-04 10:18:27 +05:30
parent bc14bc245a
commit f4f265e6ec
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -279,6 +279,13 @@ class Convert:
if fallbacks:
for choice in choices:
ac.remove(choice)
if len(fallbacks) == 1 and ac.getparent().tag.endswith('}r') and len(fallbacks[0]) == 1:
q = fallbacks[0][0]
if q.tag and (q.tag.endswith('}drawing') or q.tag.endswith('}pict')):
p = ac.getparent()
idx = p.index(ac)
p.insert(idx, q)
p.remove(ac)
def read_styles(self, relationships_by_type):