]> git.lyx.org Git - lyx.git/commitdiff
Fix layoutbox update in toolbar in order to not blank current selection
authorJohn Spray <spray@lyx.org>
Fri, 4 Mar 2005 23:58:28 +0000 (23:58 +0000)
committerJohn Spray <spray@lyx.org>
Fri, 4 Mar 2005 23:58:28 +0000 (23:58 +0000)
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

src/frontends/gtk/ChangeLog
src/frontends/gtk/GToolbar.C

index 0b51fc80bf70972d9d49aade3fc03459a9d05776..9316c350d1536420eb029f6f38b934c7337f9ca8 100644 (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
index 47c9f5162b4e9b46254b3d6ca98e7b00760a01ef..11fd48d8034098c43bd82a5abd1ed317091c0702 100644 (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