From 41f1e91600be324a3cbe79605dabf6acc4860927 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Thu, 2 Jul 2020 16:36:58 +0200 Subject: [PATCH] Coordinates containing a comma instead of a period Fixes #11823 --- gramps/gui/editors/editplace.py | 8 +++++--- gramps/gui/editors/editplaceref.py | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 38730b81c..b145d5655 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -187,9 +187,11 @@ class EditPlace(EditPrimary): def set_latlongitude(self, value): try: - coma = value.index(',') - self.longitude.set_text(value[coma+1:].strip()) - self.latitude.set_text(value[:coma].strip()) + coma = value.index(', ') + longitude = value[coma+2:].strip().replace(',','.') + latitude = value[:coma].strip().replace(',','.') + self.longitude.set_text(longitude) + self.latitude.set_text(latitude) self.top.get_object("lat_entry").validate(force=True) self.top.get_object("lon_entry").validate(force=True) self.obj.set_latitude(self.latitude.get_value()) diff --git a/gramps/gui/editors/editplaceref.py b/gramps/gui/editors/editplaceref.py index 34d2e2619..9abf05928 100644 --- a/gramps/gui/editors/editplaceref.py +++ b/gramps/gui/editors/editplaceref.py @@ -180,9 +180,11 @@ class EditPlaceRef(EditReference): def set_latlongitude(self, value): try: - coma = value.index(',') - self.longitude.set_text(value[coma+1:].strip()) - self.latitude.set_text(value[:coma].strip()) + coma = value.index(', ') + longitude = value[coma+2:].strip().replace(',','.') + latitude = value[:coma].strip().replace(',','.') + self.longitude.set_text(longitude) + self.latitude.set_text(latitude) self.top.get_object("lat_entry").validate(force=True) self.top.get_object("lon_entry").validate(force=True) self.source.set_latitude(self.latitude.get_value())