From 8b43258ac6ab2231203522e219eaaa5be536bafc Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Fri, 3 Dec 2010 21:14:39 +0000 Subject: [PATCH] When creating a new style sheet, make sure the name for it is non-empty. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19902 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/report/report-gnome/dialog-style-sheet.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/report/report-gnome/dialog-style-sheet.c b/src/report/report-gnome/dialog-style-sheet.c index 98154b4563..b80fcbc0d6 100644 --- a/src/report/report-gnome/dialog-style-sheet.c +++ b/src/report/report-gnome/dialog-style-sheet.c @@ -212,6 +212,13 @@ gnc_style_sheet_new (StyleSheetDialog * ssd) { 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,