From: KoziarekBeata <b.koziarek@samsung.com>
authorKoziarekBeata <b.koziarek@samsung.com>
Wed, 10 Oct 2012 09:26:29 +0000 (09:26 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Wed, 10 Oct 2012 09:26:29 +0000 (09:26 +0000)
Subject: [E-devel] [elementary] size value checking in elm config

This patch contains size value checks for some functions in elm_config
file.

I think that calling these function with negative size values has no
sense.

SVN revision: 77734

src/lib/elm_config.c

index 686e17d..691b0bb 100644 (file)
@@ -1641,6 +1641,7 @@ elm_config_scale_get(void)
 EAPI void
 elm_config_scale_set(double scale)
 {
+   if (scale < 0.0) return;
    if (_elm_config->scale == scale) return;
    _elm_config->scale = scale;
    _elm_rescale();
@@ -1669,6 +1670,7 @@ elm_config_password_show_last_timeout_get(void)
 EAPI void
 elm_config_password_show_last_timeout_set(double password_show_last_timeout)
 {
+   if (password_show_last_timeout < 0.0) return;
    if (_elm_config->password_show_last_timeout == password_show_last_timeout) return;
    _elm_config->password_show_last_timeout = password_show_last_timeout;
    edje_password_show_last_timeout_set(_elm_config->password_show_last_timeout);
@@ -1777,6 +1779,7 @@ elm_config_font_overlay_set(const char    *text_class,
                      Evas_Font_Size size)
 {
    EINA_SAFETY_ON_NULL_RETURN(text_class);
+   if (size < 0) return;
    _elm_config_font_overlay_set(text_class, font, size);
 }
 
@@ -1803,6 +1806,7 @@ elm_config_finger_size_get(void)
 EAPI void
 elm_config_finger_size_set(Evas_Coord size)
 {
+   if (size < 0) return;
    if (_elm_config->finger_size == size) return;
    _elm_config->finger_size = size;
    _elm_rescale();
@@ -1849,6 +1853,7 @@ elm_config_cache_font_cache_size_get(void)
 EAPI void
 elm_config_cache_font_cache_size_set(int size)
 {
+   if (size < 0) return;
    if (_elm_config->font_cache == size) return;
    _elm_config->font_cache = size;
 
@@ -1864,6 +1869,7 @@ elm_config_cache_image_cache_size_get(void)
 EAPI void
 elm_config_cache_image_cache_size_set(int size)
 {
+   if (size < 0) return;
    if (_elm_config->image_cache == size) return;
    _elm_config->image_cache = size;
 
@@ -1879,6 +1885,7 @@ elm_config_cache_edje_file_cache_size_get()
 EAPI void
 elm_config_cache_edje_file_cache_size_set(int size)
 {
+   if (size < 0) return;
    if (_elm_config->edje_cache == size) return;
    _elm_config->edje_cache = size;