]> git.lyx.org Git - features.git/commitdiff
Bug:1050
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 28 May 2003 09:54:27 +0000 (09:54 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 28 May 2003 09:54:27 +0000 (09:54 +0000)
Remove caching.

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

src/ChangeLog
src/lyxtextclass.C

index 9ac1eaa9037c45d60492ca90da79a2e2d1ebcfc2..65de4190cc2f0a650b774bdf3c92c5c364e942af 100644 (file)
@@ -1,3 +1,7 @@
+2003-05-28  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * lyxtextclass.C (operator): remove caching.
+
 2003-05-27  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * text3.C: adjust
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);
 }