From 6154a90fba843789b65d2a023c7f3cc7b72ef775 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 1 Feb 2008 15:54:40 +0000 Subject: [PATCH] small code simplification git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22736 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LaTeXFeatures.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 15547477c6..ecf02295f5 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -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(); } -- 2.39.2