]> git.lyx.org Git - lyx.git/commitdiff
* GuiToolbar.cpp (set):
authorJürgen Spitzmüller <spitz@lyx.org>
Fri, 5 Dec 2008 14:02:03 +0000 (14:02 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Fri, 5 Dec 2008 14:02:03 +0000 (14:02 +0000)
- honour obsoleted styles (part of bug 2607).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27772 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiToolbar.cpp

index 798c3b60f4a2c1309072065e051dda9f8db8f6da..5dc66b6aa5fc1bbb618297cc6a2cb9fa02c2edd5 100644 (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) {