Place editor, copy and paste of lat and long text
no longer auto-populating latitude and longitude fields Fixes #012349
This commit is contained in:
parent
a3b37b9627
commit
6dcb1d00d5
@ -187,9 +187,14 @@ class EditPlace(EditPrimary):
|
|||||||
|
|
||||||
def set_latlongitude(self, value):
|
def set_latlongitude(self, value):
|
||||||
try:
|
try:
|
||||||
coma = value.index(', ')
|
# Bug 12349
|
||||||
longitude = value[coma+2:].strip().replace(',','.')
|
parts = value.index(', ')
|
||||||
latitude = value[:coma].strip().replace(',','.')
|
if len(parts) == 2:
|
||||||
|
longitude = parts[0].strip().replace(',', '.')
|
||||||
|
latitude = parts[1].strip().replace(',', '.')
|
||||||
|
else:
|
||||||
|
longitude, latitude = value.split(',')
|
||||||
|
|
||||||
self.longitude.set_text(longitude)
|
self.longitude.set_text(longitude)
|
||||||
self.latitude.set_text(latitude)
|
self.latitude.set_text(latitude)
|
||||||
self.top.get_object("lat_entry").validate(force=True)
|
self.top.get_object("lat_entry").validate(force=True)
|
||||||
|
@ -180,9 +180,14 @@ class EditPlaceRef(EditReference):
|
|||||||
|
|
||||||
def set_latlongitude(self, value):
|
def set_latlongitude(self, value):
|
||||||
try:
|
try:
|
||||||
coma = value.index(', ')
|
# Bug 12349
|
||||||
longitude = value[coma+2:].strip().replace(',','.')
|
parts = value.index(', ')
|
||||||
latitude = value[:coma].strip().replace(',','.')
|
if len(parts) == 2:
|
||||||
|
longitude = parts[0].strip().replace(',', '.')
|
||||||
|
latitude = parts[1].strip().replace(',', '.')
|
||||||
|
else:
|
||||||
|
longitude, latitude = value.split(',')
|
||||||
|
|
||||||
self.longitude.set_text(longitude)
|
self.longitude.set_text(longitude)
|
||||||
self.latitude.set_text(latitude)
|
self.latitude.set_text(latitude)
|
||||||
self.top.get_object("lat_entry").validate(force=True)
|
self.top.get_object("lat_entry").validate(force=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user