Fix layoutbox update in toolbar in order to not blank current selection

when updating, such as on a change of document class.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9691 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Spray 2005-03-04 23:58:28 +00:00
parent 12989c9c47
commit efa09596c0
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-03-04 John Spray <spray_john@users.sf.net>
* GToolbar.C: remember existing selection when update()ing
the layoutbox, in order to cope with document class changes.
2005-01-29 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* GPrint.C (apply): use convert<int, string> to avoid undefined

View File

@ -118,10 +118,10 @@ void GLayoutBox::set(string const & layout)
void GLayoutBox::update()
{
int current_selection = combo_.get_active_row_number();
clear();
LyXTextClass const & tc = getTextClass(owner_);
LyXTextClass::const_iterator it = tc.begin();
LyXTextClass::const_iterator const end = tc.end();
@ -132,6 +132,7 @@ void GLayoutBox::update()
Gtk::TreeModel::Row row = *iter;
row[cols_.name] = Glib::locale_to_utf8((*it)->name());
}
combo_.set_active(current_selection);
internal_ = false;
// now that we've loaded something into the combobox, forget