From: Jürgen Spitzmüller Date: Fri, 5 Dec 2008 14:02:03 +0000 (+0000) Subject: * GuiToolbar.cpp (set): X-Git-Tag: 2.0.0~7599 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6edb56cf037cbb8dea9520becf82fcfc1e8f5f9c;p=features.git * GuiToolbar.cpp (set): - honour obsoleted styles (part of bug 2607). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27772 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiToolbar.cpp b/src/frontends/qt4/GuiToolbar.cpp index 798c3b60f4..5dc66b6aa5 100644 --- a/src/frontends/qt4/GuiToolbar.cpp +++ b/src/frontends/qt4/GuiToolbar.cpp @@ -508,10 +508,15 @@ void GuiLayoutBox::set(docstring const & layout) return; Layout const & lay = (*text_class_)[layout]; - QString const newLayout = toqstr(lay.name()); + QString newLayout = toqstr(lay.name()); + + // If the layout is obsolete, use the new one instead. + docstring const & obs = lay.obsoleted_by(); + if (!obs.empty()) + newLayout = toqstr(obs); int const curItem = currentIndex(); - QModelIndex const mindex = + QModelIndex const mindex = filterModel_->mapToSource(filterModel_->index(curItem, 1)); QString const & currentLayout = model_->itemFromIndex(mindex)->text(); if (newLayout == currentLayout) {