From 6221ef70fefdb4845cf19720fa129db38b485ea8 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Sun, 22 Aug 2004 16:19:45 +0000 Subject: [PATCH] (XmlWriter.write_object): Use GRAMPS ID not DB handle. svn: r3475 --- gramps2/src/WriteXML.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gramps2/src/WriteXML.py b/gramps2/src/WriteXML.py index a106ccd5d..9d9d7844f 100644 --- a/gramps2/src/WriteXML.py +++ b/gramps2/src/WriteXML.py @@ -403,9 +403,15 @@ class XmlWriter: if len(objList) > 0: self.g.write(" \n") - objList.sort () - for key in self.db.get_media_object_handles(): - object = self.db.get_object_from_handle(key) + keys = self.db.get_media_object_handles() + sorted_keys = [] + for key in keys: + object = self.db.get_object_from_handle (key) + tuple = (object.get_gramps_id (), object) + sorted_keys.append (tuple) + + sorted_keys.sort () + for (gramps_id, object) in sorted_keys: self.write_object(object) self.g.write(" \n") @@ -772,7 +778,7 @@ class XmlWriter: self.g.write(" \n") def write_object(self,object): - id = object.get_handle() + id = object.get_gramps_id() type = object.get_mime_type() path = object.get_path() if self.strip_photos: