Commit c417ef96 authored by Nicolas Delaby's avatar Nicolas Delaby

cleanup and small fixes

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31050 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f59878a1
...@@ -1040,17 +1040,13 @@ class ODGStrategy(ODFStrategy): ...@@ -1040,17 +1040,13 @@ class ODGStrategy(ODFStrategy):
field_list = form.get_fields(include_disabled=1) field_list = form.get_fields(include_disabled=1)
REQUEST = here.REQUEST REQUEST = here.REQUEST
for (count, field) in enumerate(field_list): for (count, field) in enumerate(field_list):
field_value = self._renderField(field)
value = self._toUnicodeString(field_value)
text_xpath = '//draw:frame[@draw:name="%s"]/*' % field.id text_xpath = '//draw:frame[@draw:name="%s"]/*' % field.id
node_list = element_tree.xpath(text_xpath, namespaces=element_tree.nsmap) node_list = element_tree.xpath(text_xpath, namespaces=element_tree.nsmap)
if len(node_list) is 0: if not node_list:
return element_tree continue
new_node = field.widget.render_odg(field, as_string=False) new_node = field.widget.render_odg(field, as_string=False)#XXXrender_odg should be called on field, not on widget
for node in node_list: for node in node_list:
if new_node is not None: parent_node = node.getparent().replace(node, new_node)
parent_node = node.getparent()
parent_node.replace(node, new_node)
return element_tree return element_tree
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