From: John Spray Date: Fri, 4 Mar 2005 23:58:28 +0000 (+0000) Subject: Fix layoutbox update in toolbar in order to not blank current selection X-Git-Tag: 1.6.10~14488 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=efa09596c027f42c830cc767585ca60848d882c1;p=lyx.git 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 --- diff --git a/src/frontends/gtk/ChangeLog b/src/frontends/gtk/ChangeLog index 0b51fc80bf..9316c350d1 100644 --- a/src/frontends/gtk/ChangeLog +++ b/src/frontends/gtk/ChangeLog @@ -1,3 +1,8 @@ +2005-03-04 John Spray + + * GToolbar.C: remember existing selection when update()ing + the layoutbox, in order to cope with document class changes. + 2005-01-29 Georg Baum * GPrint.C (apply): use convert to avoid undefined diff --git a/src/frontends/gtk/GToolbar.C b/src/frontends/gtk/GToolbar.C index 47c9f5162b..11fd48d803 100644 --- a/src/frontends/gtk/GToolbar.C +++ b/src/frontends/gtk/GToolbar.C @@ -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