diff --git a/gtk2_ardour/save_template_dialog.cc b/gtk2_ardour/save_template_dialog.cc index 5d23006926..e4d3f6cbeb 100644 --- a/gtk2_ardour/save_template_dialog.cc +++ b/gtk2_ardour/save_template_dialog.cc @@ -68,5 +68,11 @@ SaveTemplateDialog::get_template_name () const std::string SaveTemplateDialog::get_description () const { - return _description_editor.get_buffer()->get_text(); + std::string desc_txt = _description_editor.get_buffer()->get_text (); + std::string::reverse_iterator wss = desc_txt.rbegin(); + while (wss != desc_txt.rend() && isspace (*wss)) { + desc_txt.erase (--(wss++).base()); + } + + return desc_txt; } diff --git a/gtk2_ardour/template_dialog.cc b/gtk2_ardour/template_dialog.cc index 09adc2cb8e..696cb29dec 100644 --- a/gtk2_ardour/template_dialog.cc +++ b/gtk2_ardour/template_dialog.cc @@ -420,7 +420,12 @@ TemplateManager::save_template_desc () { const string file_path = template_file (_current_selection); - const string desc_txt = _description_editor.get_buffer()->get_text (); + string desc_txt = _description_editor.get_buffer()->get_text (); + string::reverse_iterator wss = desc_txt.rbegin(); + while (wss != desc_txt.rend() && isspace (*wss)) { + desc_txt.erase (--(wss++).base()); + } + _current_selection->set_value (_template_columns.description, desc_txt); XMLTree tree;