diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 31dd7fe4c..78ce7d53b 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -5,6 +5,8 @@ * test/runtest.sh: Add txt format and family_group report. * test/impex.sh: Add import/export test set. * example/gramps/example.gramps: Correct errors. + * src/BaseDoc.py (SheetParser.startElement): Tolerate missing + tmargin and bmargin (when reading older style files). 2005-11-22 Don Allingham * src/docgen/AbiWord2Doc.py: fix spacing for top and bottom margin diff --git a/gramps2/src/BaseDoc.py b/gramps2/src/BaseDoc.py index de4823b9b..f7c6dc2ee 100644 --- a/gramps2/src/BaseDoc.py +++ b/gramps2/src/BaseDoc.py @@ -993,8 +993,13 @@ class SheetParser(handler.ContentHandler): self.p.set_right_margin(Utils.gfloat(attrs['rmargin'])) self.p.set_left_margin(Utils.gfloat(attrs['lmargin'])) self.p.set_first_indent(Utils.gfloat(attrs['first'])) - self.p.set_top_margin(Utils.gfloat(attrs['tmargin'])) - self.p.set_bottom_margin(Utils.gfloat(attrs['bmargin'])) + try: + # This is needed to read older style files + # lacking tmargin and bmargin + self.p.set_top_margin(Utils.gfloat(attrs['tmargin'])) + self.p.set_bottom_margin(Utils.gfloat(attrs['bmargin'])) + except KeyError: + pass self.p.set_padding(Utils.gfloat(attrs['pad'])) self.p.set_alignment(int(attrs['align'])) self.p.set_right_border(int(attrs['rborder']))