small code simplification

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22736 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2008-02-01 15:54:40 +00:00
parent 9a7999746d
commit 6154a90fba

View File

@ -18,7 +18,6 @@
#include "Color.h"
#include "BufferParams.h"
#include "support/debug.h"
#include "Encoding.h"
#include "Floating.h"
#include "FloatList.h"
@ -28,9 +27,11 @@
#include "LyXRC.h"
#include "TextClass.h"
#include "support/debug.h"
#include "support/docstream.h"
#include "support/FileName.h"
#include "support/filetools.h"
#include "support/lstrings.h"
using namespace std;
using namespace lyx::support;
@ -414,13 +415,12 @@ bool LaTeXFeatures::mustProvide(string const & name) const
bool LaTeXFeatures::isAvailable(string const & name)
{
string n = name;
if (packages_.empty())
getAvailable();
size_t loc = n.rfind(".sty");
if (loc == n.length() - 4)
n = n.erase(name.length() - 4);
return find(packages_.begin(), packages_.end(), n) != packages_.end();
string n = name;
if (suffixIs(n, ".sty"))
n.erase(name.length() - 4);
return packages_.find(n) != packages_.end();
}