]> git.lyx.org Git - lyx.git/blobdiff - src/lyxtextclass.C
Make lyx2lyx output the new external inset format.
[lyx.git] / src / lyxtextclass.C
index f406915a858adc943093c714759d3e768885ea3b..74be61056f6621a49e60d71f612270913cabebb6 100644 (file)
@@ -753,20 +753,9 @@ bool LyXTextClass::hasLayout(string const & n) const
 
 
 
-LyXLayout_ptr const & LyXTextClass::operator[](string const & n) const
+LyXLayout_ptr const & LyXTextClass::operator[](string const & name) const
 {
-       lyx::Assert(!n.empty());
-
-       if (n.empty())
-               lyxerr << "LyXTextClass::operator[] called with empty n" << endl;
-
-       string const name = (n.empty() ? defaultLayoutName() : n);
-
-       static string lastLayoutName;
-       static LayoutList::difference_type lastLayoutIndex;
-
-       if (name == lastLayoutName)
-               return layoutlist_[lastLayoutIndex];
+       lyx::Assert(!name.empty());
 
        LayoutList::const_iterator cit =
                find_if(layoutlist_.begin(),
@@ -785,9 +774,6 @@ LyXLayout_ptr const & LyXTextClass::operator[](string const & n) const
                lyx::Assert(false);
        }
 
-       lastLayoutName = name;
-       lastLayoutIndex = std::distance(layoutlist_.begin(), cit);
-
        return (*cit);
 }