Commit 3a9d55cd authored by Fabien Morin's avatar Fabien Morin

- improve the way to store attributes.

- remove "if new_node is not None" expression because now their is a render_odg
  method defined on Widget Class


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31250 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f8d04a04
...@@ -956,8 +956,8 @@ class ODGStrategy(ODFStrategy): ...@@ -956,8 +956,8 @@ class ODGStrategy(ODFStrategy):
node_list = element_tree.xpath(text_xpath, namespaces=element_tree.nsmap) node_list = element_tree.xpath(text_xpath, namespaces=element_tree.nsmap)
for target_node in node_list: for target_node in node_list:
attr_dict = {} attr_dict = {}
attr_dict.update(target_node.attrib) # store child style using their local-name as key
for descendant in target_node.iterdescendants():
attr_dict.setdefault(descendant.tag, {}).update(descendant.attrib)
new_node = field.render_odg(attr_dict=attr_dict) new_node = field.render_odg(attr_dict=attr_dict)
if new_node is not None: # XXX None node exists because render_odg is
# not yet writed for all fields, but it should
parent_node = target_node.getparent().replace(target_node, new_node) parent_node = target_node.getparent().replace(target_node, new_node)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment