From: chanywa Date: Wed, 12 Oct 2016 07:39:14 +0000 (+0900) Subject: fixed to prevent changing coordinates with itself X-Git-Tag: submit/tizen/20161012.082118^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d2b7cf44091e1399cecf099b0d3f51f1227425e;p=platform%2Fcore%2Fapi%2Fmaps-service.git fixed to prevent changing coordinates with itself Change-Id: Ie204688641d4d41b11efbb33ee54c6864979a6d8 --- diff --git a/src/api/maps_view_object.cpp b/src/api/maps_view_object.cpp index 2112d7b..ae24ea2 100644 --- a/src/api/maps_view_object.cpp +++ b/src/api/maps_view_object.cpp @@ -618,8 +618,10 @@ EXPORT_API int maps_view_object_polyline_set_polyline(maps_view_object_h polylin return MAPS_ERROR_INVALID_PARAMETER; /* Set new polyline trajectory */ - maps_coordinates_list_destroy(p->points); - p->points = points; + if (p->points != points) { + maps_coordinates_list_destroy(p->points); + p->points = points; + } /* Notify view, that the object specific preferences is changed */ _maps_view_on_object_operation(__get_view(polyline), polyline, MAPS_VIEW_OBJECT_CHANGE); @@ -755,8 +757,10 @@ EXPORT_API int maps_view_object_polygon_set_polygon(maps_view_object_h polygon, return MAPS_ERROR_INVALID_PARAMETER; /* Set new polygon border */ - maps_coordinates_list_destroy(p->points); - p->points = points; + if (p->points != points) { + maps_coordinates_list_destroy(p->points); + p->points = points; + } /* Notify view, that the object specific preferences is changed */ _maps_view_on_object_operation(__get_view(polygon), polygon, MAPS_VIEW_OBJECT_CHANGE); @@ -850,9 +854,12 @@ EXPORT_API int maps_view_object_marker_set_coordinates(maps_view_object_h marker maps_view_marker_data_s *m = __get_marker_data(marker); if (!m) return MAPS_ERROR_INVALID_PARAMETER; - if (m->coordinates) + + /* Set new coordinates */ + if (m->coordinates != coordinates) { maps_coordinates_destroy(m->coordinates); - m->coordinates = coordinates; + m->coordinates = coordinates; + } /* Notify view, that the object specific preferences is changed */ _maps_view_on_object_operation(__get_view(marker), marker, MAPS_VIEW_OBJECT_CHANGE); @@ -1157,9 +1164,11 @@ EXPORT_API int maps_view_object_overlay_set_coordinates(maps_view_object_h overl maps_view_overlay_data_s *m = __get_overlay_data(overlay); if (!m) return MAPS_ERROR_INVALID_PARAMETER; - if (m->coordinates) + + if (m->coordinates != coordinates) { maps_coordinates_destroy(m->coordinates); - m->coordinates = coordinates; + m->coordinates = coordinates; + } /* Notify view, that the object specific preferences is changed */ _maps_view_on_object_operation(__get_view(overlay), overlay, MAPS_VIEW_OBJECT_CHANGE);