r19902 - gnucash/trunk/src/report/report-gnome - When creating a new style sheet, make sure the name for it is non-empty.

Christian Stimming cstim at code.gnucash.org
Fri Dec 3 16:14:40 EST 2010


Author: cstim
Date: 2010-12-03 16:14:39 -0500 (Fri, 03 Dec 2010)
New Revision: 19902
Trac: http://svn.gnucash.org/trac/changeset/19902

Modified:
   gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c
Log:
When creating a new style sheet, make sure the name for it is non-empty.

Modified: gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c	2010-12-01 17:07:11 UTC (rev 19901)
+++ gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c	2010-12-03 21:14:39 UTC (rev 19902)
@@ -212,6 +212,13 @@
     {
         template_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(template_combo));
         name_str     = gtk_entry_get_text(GTK_ENTRY(name_entry));
+        if (name_str && strlen(name_str) == 0)
+        {
+            /* If the name is empty, we display an error dialog but
+             * refuse to create the new style sheet. */
+            gnc_error_dialog (ssd->toplevel, "%s", _("You must provide a name for the new style sheet."));
+            name_str = NULL;
+        }
         if (template_str && name_str)
         {
             new_ss = scm_call_2(make_ss,



More information about the gnucash-changes mailing list