From 30fff63257c0aa1f9f6d8fc67bceeaa91f3a9a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Sat, 23 Feb 2008 22:21:03 +0000 Subject: [PATCH] compile fix git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23169 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/text.cpp | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index fbc89d3f0b..227486e22c 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -421,27 +421,12 @@ void handle_comment(ostream & os, string const & s, Context & context) } -class isLayout : public unary_function { -public: - isLayout(string const name) : name_(name) {} - bool operator()(LayoutPtr const & ptr) const { - return ptr->latexname() == name_; - } -private: - string const name_; -}; - - -LayoutPtr findLayout(TextClass const & textclass, - string const & name) +LayoutPtr findLayout(TextClass const & textclass, string const & name) { - TextClass::const_iterator beg = textclass.begin(); - TextClass::const_iterator end = textclass.end(); - - TextClass::const_iterator - it = find_if(beg, end, isLayout(name)); - - return (it == end) ? LayoutPtr() : *it; + for (size_t i = 0; i != textclass.layoutCount(); ++i) + if (textclass.layout(i)->latexname() == name) + return textclass.layout(i); + return LayoutPtr(); }