fixed to prevent changing coordinates with itself 26/91926/2 accepted/tizen/3.0/common/20161114.105226 accepted/tizen/3.0/ivi/20161028.123101 accepted/tizen/3.0/mobile/20161028.122407 accepted/tizen/3.0/tv/20161028.122634 accepted/tizen/3.0/wearable/20161028.122859 accepted/tizen/common/20161012.154747 accepted/tizen/ivi/20161013.000813 accepted/tizen/mobile/20161013.000725 accepted/tizen/tv/20161013.000740 accepted/tizen/wearable/20161013.000757 submit/tizen/20161012.082118 submit/tizen_3.0/20161028.062323 submit/tizen_3.0/20161028.082323 submit/tizen_3.0_common/20161104.104000
authorchanywa <cbible.kim@samsung.com>
Wed, 12 Oct 2016 07:39:14 +0000 (16:39 +0900)
committerchanywa <cbible.kim@samsung.com>
Wed, 12 Oct 2016 07:45:58 +0000 (16:45 +0900)
Change-Id: Ie204688641d4d41b11efbb33ee54c6864979a6d8

src/api/maps_view_object.cpp

index 2112d7b..ae24ea2 100644 (file)
@@ -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);