X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTextClass.cpp;h=cc8fb993bbe9de3d86b76f5355a93a835b5607c7;hb=cfeddb92;hp=23fd1eed9a43bb43a5a0fe256ec190c309ead0dd;hpb=f09a9fe2e60e4aeaca23b42b2bf30f5d64cfd9b1;p=lyx.git diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 23fd1eed9a..cc8fb993bb 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -58,11 +58,10 @@ namespace lyx { // LayoutFile.cpp. Additions will never do so, but syntax changes // could. See LayoutFileList::addEmptyClass() and, especially, the // definition of the layoutpost string. -// You should also run (or ask someone who has bash to run) the -// development/tools/updatelayouts.sh script, to update the format of -// all of our layout files. +// You should also run the development/tools/updatelayouts.py script, +// to update the format of all of our layout files. // -int const LAYOUT_FORMAT = 51; //spitz: add ToggleIndent tag +int const LAYOUT_FORMAT = 53; //spitz: add ObsoletedBy tag for InsetLayouts namespace { @@ -1423,13 +1422,20 @@ InsetLayout const & DocumentClass::insetLayout(docstring const & name) const InsetLayouts::const_iterator cen = insetlayoutlist_.end(); while (!n.empty()) { InsetLayouts::const_iterator cit = insetlayoutlist_.lower_bound(n); - if (cit != cen && cit->first == n) - return cit->second; + if (cit != cen && cit->first == n) { + if (cit->second.obsoleted_by().empty()) + return cit->second; + n = cit->second.obsoleted_by(); + return insetLayout(n); + } + // If we have a generic prefix (e.g., "Note:"), + // try if this one alone is found. size_t i = n.find(':'); if (i == string::npos) break; n = n.substr(0, i); } + // Layout "name" not found. return plain_insetlayout_; }