diff --git a/ChangeLog b/ChangeLog index 55ff49176..f5df82353 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-10-18 Alex Roitman + * src/docgen/OpenSpreadSheet.py (write_text): Escape special + XML characters. + 2004-10-17 Don Allingham * src/EditPerson.py: saving grouping name, instead of surname for updating of the person list diff --git a/src/docgen/OpenSpreadSheet.py b/src/docgen/OpenSpreadSheet.py index 17d5a4040..258c4f9e9 100644 --- a/src/docgen/OpenSpreadSheet.py +++ b/src/docgen/OpenSpreadSheet.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2003 Donald N. Allingham +# Copyright (C) 2000-2004 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,6 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# $Id$ + #------------------------------------------------------------------------- # # Standard Python Modules @@ -25,8 +27,8 @@ #------------------------------------------------------------------------- import os import tempfile -import string import zipfile +from gettext import gettext as _ #------------------------------------------------------------------------- # @@ -39,7 +41,6 @@ from SpreadSheetDoc import * from latin_utf8 import latin_to_utf8 import const -from gettext import gettext as _ import Errors #------------------------------------------------------------------------- @@ -387,8 +388,11 @@ class OpenSpreadSheet(SpreadSheetDoc): if self.content == 0: self.f.write('') self.content = 1 - text = string.replace(text,'\t','') - text = string.replace(text,'\n','') + text = text.replace('&','&') # Must be first + text = text.replace('<','<') + text = text.replace('>','>') + text = text.replace('\t','') + text = text.replace('\n','') self.f.write(latin_to_utf8(text)) def _write_manifest(self): @@ -471,4 +475,3 @@ class OpenSpreadSheet(SpreadSheetDoc): self.f.write('\n') self.f.write('\n') self.f.close() -