Commit 894872a0 authored by Nicolas Delaby's avatar Nicolas Delaby

ODF renderer must handle carefuly None values as empty string

like html renderer does.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42430 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e8a97a72
......@@ -217,6 +217,8 @@ class Widget:
if isinstance(value, str):
#required by lxml
value = value.decode('utf-8')
if value is None:
value = ''
text_node = Element('{%s}%s' % (TEXT_URI, local_name), nsmap=NSMAP)
text_node.text = value
text_node.attrib.update(attr_dict)
......@@ -239,6 +241,8 @@ class Widget:
if isinstance(value, str):
#required by lxml
value = value.decode('utf-8')
if value is None:
value = ''
text_node = Element('{%s}%s' % (TEXT_URI, local_name), nsmap=NSMAP)
text_node.text = value
text_node.attrib.update(attr_dict)
......@@ -280,6 +284,8 @@ class Widget:
if isinstance(value, str):
#required by lxml
value = value.decode('utf-8')
if value is None:
value = ''
draw_frame_tag_name = '{%s}%s' % (DRAW_URI, 'frame')
draw_frame_node = Element(draw_frame_tag_name, nsmap=NSMAP)
draw_frame_attribute_list = attr_dict.get(draw_frame_tag_name)
......
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