* src/docgen/OpenOfficeDoc.py: Escape special XML characters.

svn: r1720
This commit is contained in:
Alex Roitman 2003-06-13 15:13:47 +00:00
parent 614aa121da
commit 59567076ce
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,6 @@
2003-06-13 Tim Waugh <twaugh@redhat.com>
* src/docgen/OpenOfficeDoc.py: Escape special XML characters.
2003-06-12 Tim Waugh <twaugh@redhat.com> 2003-06-12 Tim Waugh <twaugh@redhat.com>
* src/docgen/OpenOfficeDoc.py: Surround images by paragraph tags * src/docgen/OpenOfficeDoc.py: Surround images by paragraph tags
when inside the table cell. when inside the table cell.

View File

@ -521,6 +521,9 @@ class OpenOfficeDoc(TextDoc.TextDoc):
self.new_cell = 1 self.new_cell = 1
def write_text(self,text): def write_text(self,text):
text = string.replace(text,'&','&amp;'); # Must be first
text = string.replace(text,'<','&lt;');
text = string.replace(text,'>','&gt;');
text = string.replace(text,'\n','<text:line-break/>') text = string.replace(text,'\n','<text:line-break/>')
self.f.write(text) self.f.write(text)