5120: 'Export view' to odt file crashs (patch by PaulFranklin)

svn: r17985
This commit is contained in:
Jérôme Rapinat 2011-08-02 06:00:38 +00:00
parent a6879dbf62
commit e43b3fa3f1

View File

@ -385,12 +385,13 @@ class ODSTab(TabbedDoc):
self.f.write('>\n') self.f.write('>\n')
self.f.write('<text:p>') self.f.write('<text:p>')
text = text.replace('&','&amp;') # Must be first if text is not None: # it must not be just 'if text'
text = text.replace('<','&lt;') text = text.replace('&','&amp;') # Must be first
text = text.replace('>','&gt;') text = text.replace('<','&lt;')
text = text.replace('\t','<text:tab-stop/>') text = text.replace('>','&gt;')
text = text.replace('\n','<text:line-break/>') text = text.replace('\t','<text:tab-stop/>')
self.f.write(unicode(text)) text = text.replace('\n','<text:line-break/>')
self.f.write(unicode(text))
self.f.write('</text:p>\n') self.f.write('</text:p>\n')
self.f.write('</table:table-cell>\n') self.f.write('</table:table-cell>\n')