Setting of long-name on setting label only if it is null.
authorAndrea Zagli <azagli@libero.it>
Sun, 7 May 2017 13:33:09 +0000 (15:33 +0200)
committerAndrea Zagli <azagli@libero.it>
Sun, 7 May 2017 13:33:09 +0000 (15:33 +0200)
src/formelement.c

index 9a2717cfebd1ce8473741202ff598217176dc9bf..b3a790a1308500fdc84cc201bd24f0023a989aa9 100644 (file)
@@ -140,7 +140,10 @@ zak_form_cgi_form_element_set_label (ZakFormCgiFormElement *element, const gchar
                        g_hash_table_replace (priv->ht_label_attrs, "for", priv->id != NULL  ? g_strdup (priv->id) : g_strdup (""));
                        g_hash_table_replace (priv->ht_label_attrs, "class", g_strdup ("control-label"));
 
-                       zak_form_element_set_long_name (ZAK_FORM_ELEMENT (element), label);
+                       if (zak_form_element_get_long_name (ZAK_FORM_ELEMENT (element)) == NULL)
+                               {
+                                       zak_form_element_set_long_name (ZAK_FORM_ELEMENT (element), label);
+                               }
                }
 }