From 9860fdb941d21af326fc50ae9d9b999488921658 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Fri, 9 Dec 2016 18:57:06 +0000 Subject: [PATCH] 9737: Fix house number concatenation --- gramps/gen/display/place.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gramps/gen/display/place.py b/gramps/gen/display/place.py index 7a390f798..84172f5d2 100644 --- a/gramps/gen/display/place.py +++ b/gramps/gen/display/place.py @@ -65,13 +65,18 @@ class PlaceDisplay(object): else: places = places[index:] - names = [item[0] for item in places] - if config.get('preferences.place-number'): - if len(places) > 1 and int(places[0][1]) == PlaceType.NUMBER: - names = names[1:] - names[0] = places[0][0] + ' ' + names[0] + types = [item[1] for item in places] + try: + idx = types.index(PlaceType.NUMBER) + except ValueError: + idx = None + if idx is not None and len(places) > idx+1: + combined = (places[idx][0] + ' ' + places[idx+1][0], + places[idx+1][1]) + places = places[:idx] + [combined] + places[idx+2:] + names = [item[0] for item in places] if config.get('preferences.place-reverse'): names.reverse()