mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +00:00
Bug:1050
Remove caching. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7058 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d5f3bad9bb
commit
42ef3b28a2
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user