From 13e320213a2ba056f4f4c03dec8c0eb171b72165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Sun, 22 Jul 2012 05:29:03 +0000 Subject: [PATCH] 5914: Cannot save bookmarked citations into Gramps XML file format svn: r20047 --- data/grampsxml.dtd | 2 +- data/grampsxml.rng | 1 + src/plugins/export/ExportXml.py | 6 +++++- src/plugins/import/ImportXml.py | 4 ++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/data/grampsxml.dtd b/data/grampsxml.dtd index ee0c79f7a..667c4a317 100644 --- a/data/grampsxml.dtd +++ b/data/grampsxml.dtd @@ -383,7 +383,7 @@ BOOKMARKS diff --git a/data/grampsxml.rng b/data/grampsxml.rng index 25a0f140a..258889cb1 100644 --- a/data/grampsxml.rng +++ b/data/grampsxml.rng @@ -546,6 +546,7 @@ family event source + citation place media repository diff --git a/src/plugins/export/ExportXml.py b/src/plugins/export/ExportXml.py index a73452f28..948d13eaf 100644 --- a/src/plugins/export/ExportXml.py +++ b/src/plugins/export/ExportXml.py @@ -366,6 +366,7 @@ class GrampsXmlWriter(UpdateCallback): bm_family_len = len(self.db.family_bookmarks.get()) bm_event_len = len(self.db.event_bookmarks.get()) bm_source_len = len(self.db.source_bookmarks.get()) + bm_citation_len = len(self.db.citation_bookmarks.get()) bm_place_len = len(self.db.place_bookmarks.get()) bm_repo_len = len(self.db.repo_bookmarks.get()) bm_obj_len = len(self.db.media_bookmarks.get()) @@ -373,7 +374,7 @@ class GrampsXmlWriter(UpdateCallback): bm_len = (bm_person_len + bm_family_len + bm_event_len + bm_source_len + bm_place_len + bm_repo_len + - bm_obj_len + bm_note_len + bm_citation_len + bm_obj_len + bm_note_len ) if bm_len > 0: @@ -391,6 +392,9 @@ class GrampsXmlWriter(UpdateCallback): for handle in self.db.get_source_bookmarks().get(): self.g.write(' \n' % handle ) + for handle in self.db.get_citation_bookmarks().get(): + self.g.write(' \n' + % handle ) for handle in self.db.get_place_bookmarks().get(): self.g.write(' \n' % handle ) diff --git a/src/plugins/import/ImportXml.py b/src/plugins/import/ImportXml.py index 45154a473..d34da3bec 100644 --- a/src/plugins/import/ImportXml.py +++ b/src/plugins/import/ImportXml.py @@ -1286,6 +1286,10 @@ class GrampsParser(UpdateCallback): if (self.db.get_source_from_handle(handle) is not None and handle not in self.db.source_bookmarks.get() ): self.db.source_bookmarks.append(handle) + elif target == 'citation': + if (self.db.get_citation_from_handle(handle) is not None + and handle not in self.db.citation_bookmarks.get() ): + self.db.citation_bookmarks.append(handle) elif target == 'place': if (self.db.get_place_from_handle(handle) is not None and handle not in self.db.place_bookmarks.get() ):