Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix images rendered in for loops #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion aeroolib/plugins/opendocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,12 @@ def _handle_images(self, tree):
xpath_expr = "//draw:frame[starts-with(@draw:name, 'image:')]"
for draw in tree.xpath(xpath_expr, namespaces=self.namespaces):
d_name = draw.attrib[draw_name][6:].strip()
draw.attrib[draw_name] = "Aeroo picture "

# Libreoffice will automatically allocate a name to the image frame
# If we let something in the name attribute, only the first 2
# frames will be rendered.
del draw.attrib[draw_name]

attr_expr = "__aeroo_make_href(%s)" % d_name
image_node = EtreeElement(draw_image,
attrib={py_attrs: attr_expr},
Expand Down