8683: fix duplicate <name> element on pre-1.7.0 XML version
XML: use <pname> tag into place hierarchy instead of duplicate <name>
This commit is contained in:
@@ -736,7 +736,7 @@ class GrampsXmlWriter(UpdateCallback):
|
||||
value = place_name.get_value()
|
||||
date = place_name.get_date_object()
|
||||
lang = place_name.get_language()
|
||||
self.g.write('%s<name value="%s"' % (sp, self.fix(value)))
|
||||
self.g.write('%s<pname value="%s"' % (sp, self.fix(value)))
|
||||
if lang:
|
||||
self.g.write(' lang="%s"' % self.fix(lang))
|
||||
if date.is_empty():
|
||||
@@ -744,7 +744,7 @@ class GrampsXmlWriter(UpdateCallback):
|
||||
else:
|
||||
self.g.write('>\n')
|
||||
self.write_date(date, index+1)
|
||||
self.g.write('%s</name>\n' % sp)
|
||||
self.g.write('%s</pname>\n' % sp)
|
||||
|
||||
def write_event(self,event,index=1):
|
||||
if not event:
|
||||
|
||||
@@ -690,7 +690,8 @@ class GrampsParser(UpdateCallback):
|
||||
"places": (None, self.stop_places),
|
||||
"placeobj": (self.start_placeobj, self.stop_placeobj),
|
||||
"placeref": (self.start_placeref, self.stop_placeref),
|
||||
"ptitle": (None, self.stop_ptitle),
|
||||
"ptitle": (None, self.stop_ptitle),
|
||||
"pname": (self.start_place_name, self.stop_place_name),
|
||||
"location": (self.start_location, None),
|
||||
"lds_ord": (self.start_lds_ord, self.stop_lds_ord),
|
||||
"temple": (self.start_temple, None),
|
||||
@@ -1701,8 +1702,8 @@ class GrampsParser(UpdateCallback):
|
||||
def start_name(self, attrs):
|
||||
if self.person:
|
||||
self.start_person_name(attrs)
|
||||
else:
|
||||
self.start_place_name(attrs)
|
||||
#else:
|
||||
#self.start_place_name(attrs)
|
||||
|
||||
def start_place_name(self, attrs):
|
||||
self.place_name = PlaceName()
|
||||
@@ -2691,8 +2692,8 @@ class GrampsParser(UpdateCallback):
|
||||
def stop_name(self, attrs):
|
||||
if self.person:
|
||||
self.stop_person_name(attrs)
|
||||
else:
|
||||
self.stop_place_name(attrs)
|
||||
#else:
|
||||
#self.stop_place_name(attrs)
|
||||
|
||||
def stop_place_name(self, tag):
|
||||
self.place_name = None
|
||||
|
||||
Reference in New Issue
Block a user