From 35bd104ca1546396ffdb63dd7e02b0f20ad8d86f Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Fri, 20 May 2005 19:51:30 +0000 Subject: [PATCH] * src/WriteXML.py: Remove unnecessary database reads, so it does no longer crash when exporting a corrupt database. svn: r4642 --- gramps2/ChangeLog | 4 ++++ gramps2/src/WriteXML.py | 15 +++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 2174db191..3ad2346ac 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2005-05-20 Martin Hawlisch + * src/WriteXML.py: Remove unnecessary database reads, so it does no + longer crash when exporting a corrupt database. + 2005-05-20 Alex Roitman * src/SelectObject.py (on_select_row): Properly get mime type. * src/GrampsBSDDB.py (remove_object): Use correct key for transaction. diff --git a/gramps2/src/WriteXML.py b/gramps2/src/WriteXML.py index 3d9796ea8..9a973dacb 100644 --- a/gramps2/src/WriteXML.py +++ b/gramps2/src/WriteXML.py @@ -306,13 +306,11 @@ class XmlWriter: frel=' frel="%s"' % const.child_rel_notrans[alt[2]] else: frel='' - parent_family = self.db.get_family_from_handle (alt[0]) self.g.write(" \n" % \ - (parent_family.get_handle(), mrel, frel)) + (alt[0], mrel, frel)) for family_handle in person.get_family_handle_list(): - family = self.db.get_family_from_handle (family_handle) - self.write_ref("parentin",family.get_handle(),3) + self.write_ref("parentin",family_handle,3) self.write_note("note",person.get_note_object(),3) for s in person.get_source_references(): @@ -341,11 +339,9 @@ class XmlWriter: fhandle = family.get_father_handle() mhandle = family.get_mother_handle() if fhandle: - fid = self.db.get_person_from_handle (fhandle).get_handle() - self.write_ref("father",fid,3) + self.write_ref("father",fhandle,3) if mhandle: - mid = self.db.get_person_from_handle (mhandle).get_handle() - self.write_ref("mother",mid,3) + self.write_ref("mother",mhandle,3) for event_handle in family.get_event_list(): event = self.db.get_event_from_handle(event_handle) self.dump_event(event,3) @@ -355,8 +351,7 @@ class XmlWriter: if len(family.get_child_handle_list()) > 0: for person_handle in family.get_child_handle_list(): - person = self.db.get_person_from_handle (person_handle) - self.write_ref("child",person.get_handle(),3) + self.write_ref("child",person_handle,3) self.write_attribute_list(family.get_attribute_list()) self.write_note("note",family.get_note_object(),3) for s in family.get_source_references():