* 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
This commit is contained in:
Jürgen Spitzmüller 2008-12-05 14:02:03 +00:00
parent 287de0508d
commit 6edb56cf03

View File

@ -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) {